diff --git a/packages/proto/src/gen/archway.callback.v1.rs b/packages/proto/src/gen/archway.callback.v1.rs index c04921f..03d42fe 100644 --- a/packages/proto/src/gen/archway.callback.v1.rs +++ b/packages/proto/src/gen/archway.callback.v1.rs @@ -1,5 +1,6 @@ // @generated /// Callback defines the callback structure. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Callback { @@ -30,6 +31,7 @@ impl ::prost::Name for Callback { } } /// CallbackFeesFeeSplit is the breakdown of all the fees that need to be paid by the contract to reserve a callback +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CallbackFeesFeeSplit { @@ -56,6 +58,7 @@ impl ::prost::Name for CallbackFeesFeeSplit { } } /// Params defines the module parameters. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -83,7 +86,19 @@ impl ::prost::Name for Params { } } /// ModuleErrors defines the module level error codes -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum ModuleErrors { /// ERR_UNKNOWN is the default error code @@ -116,6 +131,7 @@ impl ModuleErrors { } } /// CallbackRegisteredEvent is emitted when a callback is registered. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CallbackRegisteredEvent { @@ -143,6 +159,7 @@ impl ::prost::Name for CallbackRegisteredEvent { } } /// CallbackCancelledEvent is emitted when a callback is cancelled. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CallbackCancelledEvent { @@ -170,6 +187,7 @@ impl ::prost::Name for CallbackCancelledEvent { } } /// CallbackExecutedSuccessEvent is emitted when a callback is executed successfully. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CallbackExecutedSuccessEvent { @@ -194,6 +212,7 @@ impl ::prost::Name for CallbackExecutedSuccessEvent { } } /// CallbackExecutedFailedEvent is emitted when a callback execution fails. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CallbackExecutedFailedEvent { @@ -221,6 +240,7 @@ impl ::prost::Name for CallbackExecutedFailedEvent { } } /// GenesisState defines the initial state of the callback module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -239,6 +259,7 @@ impl ::prost::Name for GenesisState { } } /// QueryParamsRequest is the request for Query.Params. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} @@ -250,6 +271,7 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse is the response for Query.Params. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -265,6 +287,7 @@ impl ::prost::Name for QueryParamsResponse { } } /// QueryEstimateCallbackFeesRequest is the request for Query.EstimateCallbackFees. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEstimateCallbackFeesRequest { @@ -280,6 +303,7 @@ impl ::prost::Name for QueryEstimateCallbackFeesRequest { } } /// QueryEstimateCallbackFeesResponse is the response for Query.EstimateCallbackFees. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEstimateCallbackFeesResponse { @@ -298,6 +322,7 @@ impl ::prost::Name for QueryEstimateCallbackFeesResponse { } } /// QueryCallbacksRequest is the request for Query.Callbacks. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCallbacksRequest { @@ -313,6 +338,7 @@ impl ::prost::Name for QueryCallbacksRequest { } } /// QueryCallbacksResponse is the response for Query.Callbacks. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCallbacksResponse { @@ -328,6 +354,7 @@ impl ::prost::Name for QueryCallbacksResponse { } } /// MsgUpdateParams is the Msg/UpdateParams request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -348,6 +375,7 @@ impl ::prost::Name for MsgUpdateParams { } } /// MsgUpdateParamsResponse defines the response structure for executing a MsgUpdateParams message. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} @@ -359,6 +387,7 @@ impl ::prost::Name for MsgUpdateParamsResponse { } } /// MsgRequestCallback is the Msg/RequestCallback request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRequestCallback { @@ -386,6 +415,7 @@ impl ::prost::Name for MsgRequestCallback { } } /// MsgRequestCallbackResponse defines the response structure for executing a MsgRequestCallback message. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRequestCallbackResponse {} @@ -397,6 +427,7 @@ impl ::prost::Name for MsgRequestCallbackResponse { } } /// MsgCancelCallback is the Msg/CancelCallback request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelCallback { @@ -421,6 +452,7 @@ impl ::prost::Name for MsgCancelCallback { } } /// MsgCancelCallbackResponse defines the response structure for executing a MsgCancelCallback message. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelCallbackResponse { @@ -1517,6 +1549,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x12, 0x03, 0x49, 0x26, 0x46, 0x0a, 0x0f, 0x0a, 0x08, 0x04, 0x05, 0x02, 0x00, 0x08, 0xe9, 0xfb, 0x03, 0x12, 0x03, 0x49, 0x28, 0x44, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("archway.callback.v1.serde.rs"); include!("archway.callback.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/archway.callback.v1.serde.rs b/packages/proto/src/gen/archway.callback.v1.serde.rs deleted file mode 100644 index 0c68718..0000000 --- a/packages/proto/src/gen/archway.callback.v1.serde.rs +++ /dev/null @@ -1,2812 +0,0 @@ -// @generated -impl serde::Serialize for Callback { - #[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.job_id != 0 { - len += 1; - } - if self.callback_height != 0 { - len += 1; - } - if self.fee_split.is_some() { - len += 1; - } - if !self.reserved_by.is_empty() { - len += 1; - } - if self.max_gas_limit != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("archway.callback.v1.Callback", len)?; - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - if self.job_id != 0 { - struct_ser.serialize_field("jobId", ToString::to_string(&self.job_id).as_str())?; - } - if self.callback_height != 0 { - struct_ser.serialize_field( - "callbackHeight", - ToString::to_string(&self.callback_height).as_str(), - )?; - } - if let Some(v) = self.fee_split.as_ref() { - struct_ser.serialize_field("feeSplit", v)?; - } - if !self.reserved_by.is_empty() { - struct_ser.serialize_field("reservedBy", &self.reserved_by)?; - } - if self.max_gas_limit != 0 { - struct_ser.serialize_field( - "maxGasLimit", - ToString::to_string(&self.max_gas_limit).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Callback { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "contract_address", - "contractAddress", - "job_id", - "jobId", - "callback_height", - "callbackHeight", - "fee_split", - "feeSplit", - "reserved_by", - "reservedBy", - "max_gas_limit", - "maxGasLimit", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ContractAddress, - JobId, - CallbackHeight, - FeeSplit, - ReservedBy, - MaxGasLimit, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } - "jobId" | "job_id" => Ok(GeneratedField::JobId), - "callbackHeight" | "callback_height" => { - Ok(GeneratedField::CallbackHeight) - } - "feeSplit" | "fee_split" => Ok(GeneratedField::FeeSplit), - "reservedBy" | "reserved_by" => Ok(GeneratedField::ReservedBy), - "maxGasLimit" | "max_gas_limit" => Ok(GeneratedField::MaxGasLimit), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Callback; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.callback.v1.Callback") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut contract_address__ = None; - let mut job_id__ = None; - let mut callback_height__ = None; - let mut fee_split__ = None; - let mut reserved_by__ = None; - let mut max_gas_limit__ = 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::JobId => { - if job_id__.is_some() { - return Err(serde::de::Error::duplicate_field("jobId")); - } - job_id__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::CallbackHeight => { - if callback_height__.is_some() { - return Err(serde::de::Error::duplicate_field("callbackHeight")); - } - callback_height__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::FeeSplit => { - if fee_split__.is_some() { - return Err(serde::de::Error::duplicate_field("feeSplit")); - } - fee_split__ = map.next_value()?; - } - GeneratedField::ReservedBy => { - if reserved_by__.is_some() { - return Err(serde::de::Error::duplicate_field("reservedBy")); - } - reserved_by__ = Some(map.next_value()?); - } - GeneratedField::MaxGasLimit => { - if max_gas_limit__.is_some() { - return Err(serde::de::Error::duplicate_field("maxGasLimit")); - } - max_gas_limit__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(Callback { - contract_address: contract_address__.unwrap_or_default(), - job_id: job_id__.unwrap_or_default(), - callback_height: callback_height__.unwrap_or_default(), - fee_split: fee_split__, - reserved_by: reserved_by__.unwrap_or_default(), - max_gas_limit: max_gas_limit__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("archway.callback.v1.Callback", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for CallbackCancelledEvent { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.cancelled_by.is_empty() { - len += 1; - } - if !self.contract_address.is_empty() { - len += 1; - } - if self.job_id != 0 { - len += 1; - } - if self.callback_height != 0 { - len += 1; - } - if self.refund_amount.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.callback.v1.CallbackCancelledEvent", len)?; - if !self.cancelled_by.is_empty() { - struct_ser.serialize_field("cancelledBy", &self.cancelled_by)?; - } - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - if self.job_id != 0 { - struct_ser.serialize_field("jobId", ToString::to_string(&self.job_id).as_str())?; - } - if self.callback_height != 0 { - struct_ser.serialize_field( - "callbackHeight", - ToString::to_string(&self.callback_height).as_str(), - )?; - } - if let Some(v) = self.refund_amount.as_ref() { - struct_ser.serialize_field("refundAmount", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CallbackCancelledEvent { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "cancelled_by", - "cancelledBy", - "contract_address", - "contractAddress", - "job_id", - "jobId", - "callback_height", - "callbackHeight", - "refund_amount", - "refundAmount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - CancelledBy, - ContractAddress, - JobId, - CallbackHeight, - RefundAmount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "cancelledBy" | "cancelled_by" => Ok(GeneratedField::CancelledBy), - "contractAddress" | "contract_address" => { - Ok(GeneratedField::ContractAddress) - } - "jobId" | "job_id" => Ok(GeneratedField::JobId), - "callbackHeight" | "callback_height" => { - Ok(GeneratedField::CallbackHeight) - } - "refundAmount" | "refund_amount" => Ok(GeneratedField::RefundAmount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CallbackCancelledEvent; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.callback.v1.CallbackCancelledEvent") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut cancelled_by__ = None; - let mut contract_address__ = None; - let mut job_id__ = None; - let mut callback_height__ = None; - let mut refund_amount__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::CancelledBy => { - if cancelled_by__.is_some() { - return Err(serde::de::Error::duplicate_field("cancelledBy")); - } - cancelled_by__ = Some(map.next_value()?); - } - GeneratedField::ContractAddress => { - if contract_address__.is_some() { - return Err(serde::de::Error::duplicate_field("contractAddress")); - } - contract_address__ = Some(map.next_value()?); - } - GeneratedField::JobId => { - if job_id__.is_some() { - return Err(serde::de::Error::duplicate_field("jobId")); - } - job_id__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::CallbackHeight => { - if callback_height__.is_some() { - return Err(serde::de::Error::duplicate_field("callbackHeight")); - } - callback_height__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::RefundAmount => { - if refund_amount__.is_some() { - return Err(serde::de::Error::duplicate_field("refundAmount")); - } - refund_amount__ = map.next_value()?; - } - } - } - Ok(CallbackCancelledEvent { - cancelled_by: cancelled_by__.unwrap_or_default(), - contract_address: contract_address__.unwrap_or_default(), - job_id: job_id__.unwrap_or_default(), - callback_height: callback_height__.unwrap_or_default(), - refund_amount: refund_amount__, - }) - } - } - deserializer.deserialize_struct( - "archway.callback.v1.CallbackCancelledEvent", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for CallbackExecutedFailedEvent { - #[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.job_id != 0 { - len += 1; - } - if !self.sudo_msg.is_empty() { - len += 1; - } - if self.gas_used != 0 { - len += 1; - } - if !self.error.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.callback.v1.CallbackExecutedFailedEvent", len)?; - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - if self.job_id != 0 { - struct_ser.serialize_field("jobId", ToString::to_string(&self.job_id).as_str())?; - } - if !self.sudo_msg.is_empty() { - struct_ser.serialize_field("sudoMsg", &self.sudo_msg)?; - } - if self.gas_used != 0 { - struct_ser.serialize_field("gasUsed", ToString::to_string(&self.gas_used).as_str())?; - } - if !self.error.is_empty() { - struct_ser.serialize_field("error", &self.error)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CallbackExecutedFailedEvent { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "contract_address", - "contractAddress", - "job_id", - "jobId", - "sudo_msg", - "sudoMsg", - "gas_used", - "gasUsed", - "error", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ContractAddress, - JobId, - SudoMsg, - GasUsed, - Error, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } - "jobId" | "job_id" => Ok(GeneratedField::JobId), - "sudoMsg" | "sudo_msg" => Ok(GeneratedField::SudoMsg), - "gasUsed" | "gas_used" => Ok(GeneratedField::GasUsed), - "error" => Ok(GeneratedField::Error), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CallbackExecutedFailedEvent; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.callback.v1.CallbackExecutedFailedEvent") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut contract_address__ = None; - let mut job_id__ = None; - let mut sudo_msg__ = None; - let mut gas_used__ = None; - let mut error__ = 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::JobId => { - if job_id__.is_some() { - return Err(serde::de::Error::duplicate_field("jobId")); - } - job_id__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::SudoMsg => { - if sudo_msg__.is_some() { - return Err(serde::de::Error::duplicate_field("sudoMsg")); - } - sudo_msg__ = Some(map.next_value()?); - } - 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::Error => { - if error__.is_some() { - return Err(serde::de::Error::duplicate_field("error")); - } - error__ = Some(map.next_value()?); - } - } - } - Ok(CallbackExecutedFailedEvent { - contract_address: contract_address__.unwrap_or_default(), - job_id: job_id__.unwrap_or_default(), - sudo_msg: sudo_msg__.unwrap_or_default(), - gas_used: gas_used__.unwrap_or_default(), - error: error__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.callback.v1.CallbackExecutedFailedEvent", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for CallbackExecutedSuccessEvent { - #[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.job_id != 0 { - len += 1; - } - if !self.sudo_msg.is_empty() { - len += 1; - } - if self.gas_used != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.callback.v1.CallbackExecutedSuccessEvent", len)?; - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - if self.job_id != 0 { - struct_ser.serialize_field("jobId", ToString::to_string(&self.job_id).as_str())?; - } - if !self.sudo_msg.is_empty() { - struct_ser.serialize_field("sudoMsg", &self.sudo_msg)?; - } - if self.gas_used != 0 { - struct_ser.serialize_field("gasUsed", ToString::to_string(&self.gas_used).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CallbackExecutedSuccessEvent { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "contract_address", - "contractAddress", - "job_id", - "jobId", - "sudo_msg", - "sudoMsg", - "gas_used", - "gasUsed", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ContractAddress, - JobId, - SudoMsg, - GasUsed, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } - "jobId" | "job_id" => Ok(GeneratedField::JobId), - "sudoMsg" | "sudo_msg" => Ok(GeneratedField::SudoMsg), - "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 = CallbackExecutedSuccessEvent; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.callback.v1.CallbackExecutedSuccessEvent") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut contract_address__ = None; - let mut job_id__ = None; - let mut sudo_msg__ = None; - let mut gas_used__ = 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::JobId => { - if job_id__.is_some() { - return Err(serde::de::Error::duplicate_field("jobId")); - } - job_id__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::SudoMsg => { - if sudo_msg__.is_some() { - return Err(serde::de::Error::duplicate_field("sudoMsg")); - } - sudo_msg__ = Some(map.next_value()?); - } - 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(CallbackExecutedSuccessEvent { - contract_address: contract_address__.unwrap_or_default(), - job_id: job_id__.unwrap_or_default(), - sudo_msg: sudo_msg__.unwrap_or_default(), - gas_used: gas_used__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.callback.v1.CallbackExecutedSuccessEvent", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for CallbackFeesFeeSplit { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.transaction_fees.is_some() { - len += 1; - } - if self.block_reservation_fees.is_some() { - len += 1; - } - if self.future_reservation_fees.is_some() { - len += 1; - } - if self.surplus_fees.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.callback.v1.CallbackFeesFeeSplit", len)?; - if let Some(v) = self.transaction_fees.as_ref() { - struct_ser.serialize_field("transactionFees", v)?; - } - if let Some(v) = self.block_reservation_fees.as_ref() { - struct_ser.serialize_field("blockReservationFees", v)?; - } - if let Some(v) = self.future_reservation_fees.as_ref() { - struct_ser.serialize_field("futureReservationFees", v)?; - } - if let Some(v) = self.surplus_fees.as_ref() { - struct_ser.serialize_field("surplusFees", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CallbackFeesFeeSplit { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "transaction_fees", - "transactionFees", - "block_reservation_fees", - "blockReservationFees", - "future_reservation_fees", - "futureReservationFees", - "surplus_fees", - "surplusFees", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - TransactionFees, - BlockReservationFees, - FutureReservationFees, - SurplusFees, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "transactionFees" | "transaction_fees" => { - Ok(GeneratedField::TransactionFees) - } - "blockReservationFees" | "block_reservation_fees" => { - Ok(GeneratedField::BlockReservationFees) - } - "futureReservationFees" | "future_reservation_fees" => { - Ok(GeneratedField::FutureReservationFees) - } - "surplusFees" | "surplus_fees" => Ok(GeneratedField::SurplusFees), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CallbackFeesFeeSplit; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.callback.v1.CallbackFeesFeeSplit") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut transaction_fees__ = None; - let mut block_reservation_fees__ = None; - let mut future_reservation_fees__ = None; - let mut surplus_fees__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::TransactionFees => { - if transaction_fees__.is_some() { - return Err(serde::de::Error::duplicate_field("transactionFees")); - } - transaction_fees__ = map.next_value()?; - } - GeneratedField::BlockReservationFees => { - if block_reservation_fees__.is_some() { - return Err(serde::de::Error::duplicate_field( - "blockReservationFees", - )); - } - block_reservation_fees__ = map.next_value()?; - } - GeneratedField::FutureReservationFees => { - if future_reservation_fees__.is_some() { - return Err(serde::de::Error::duplicate_field( - "futureReservationFees", - )); - } - future_reservation_fees__ = map.next_value()?; - } - GeneratedField::SurplusFees => { - if surplus_fees__.is_some() { - return Err(serde::de::Error::duplicate_field("surplusFees")); - } - surplus_fees__ = map.next_value()?; - } - } - } - Ok(CallbackFeesFeeSplit { - transaction_fees: transaction_fees__, - block_reservation_fees: block_reservation_fees__, - future_reservation_fees: future_reservation_fees__, - surplus_fees: surplus_fees__, - }) - } - } - deserializer.deserialize_struct( - "archway.callback.v1.CallbackFeesFeeSplit", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for CallbackRegisteredEvent { - #[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.job_id != 0 { - len += 1; - } - if self.callback_height != 0 { - len += 1; - } - if self.fee_split.is_some() { - len += 1; - } - if !self.reserved_by.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.callback.v1.CallbackRegisteredEvent", len)?; - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - if self.job_id != 0 { - struct_ser.serialize_field("jobId", ToString::to_string(&self.job_id).as_str())?; - } - if self.callback_height != 0 { - struct_ser.serialize_field( - "callbackHeight", - ToString::to_string(&self.callback_height).as_str(), - )?; - } - if let Some(v) = self.fee_split.as_ref() { - struct_ser.serialize_field("feeSplit", v)?; - } - if !self.reserved_by.is_empty() { - struct_ser.serialize_field("reservedBy", &self.reserved_by)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CallbackRegisteredEvent { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "contract_address", - "contractAddress", - "job_id", - "jobId", - "callback_height", - "callbackHeight", - "fee_split", - "feeSplit", - "reserved_by", - "reservedBy", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ContractAddress, - JobId, - CallbackHeight, - FeeSplit, - ReservedBy, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } - "jobId" | "job_id" => Ok(GeneratedField::JobId), - "callbackHeight" | "callback_height" => { - Ok(GeneratedField::CallbackHeight) - } - "feeSplit" | "fee_split" => Ok(GeneratedField::FeeSplit), - "reservedBy" | "reserved_by" => Ok(GeneratedField::ReservedBy), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CallbackRegisteredEvent; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.callback.v1.CallbackRegisteredEvent") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut contract_address__ = None; - let mut job_id__ = None; - let mut callback_height__ = None; - let mut fee_split__ = None; - let mut reserved_by__ = 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::JobId => { - if job_id__.is_some() { - return Err(serde::de::Error::duplicate_field("jobId")); - } - job_id__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::CallbackHeight => { - if callback_height__.is_some() { - return Err(serde::de::Error::duplicate_field("callbackHeight")); - } - callback_height__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::FeeSplit => { - if fee_split__.is_some() { - return Err(serde::de::Error::duplicate_field("feeSplit")); - } - fee_split__ = map.next_value()?; - } - GeneratedField::ReservedBy => { - if reserved_by__.is_some() { - return Err(serde::de::Error::duplicate_field("reservedBy")); - } - reserved_by__ = Some(map.next_value()?); - } - } - } - Ok(CallbackRegisteredEvent { - contract_address: contract_address__.unwrap_or_default(), - job_id: job_id__.unwrap_or_default(), - callback_height: callback_height__.unwrap_or_default(), - fee_split: fee_split__, - reserved_by: reserved_by__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.callback.v1.CallbackRegisteredEvent", - FIELDS, - GeneratedVisitor, - ) - } -} -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.callbacks.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.callback.v1.GenesisState", len)?; - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - if !self.callbacks.is_empty() { - struct_ser.serialize_field("callbacks", &self.callbacks)?; - } - struct_ser.end() - } -} -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", "callbacks"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - Callbacks, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "callbacks" => Ok(GeneratedField::Callbacks), - _ => 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 archway.callback.v1.GenesisState") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut params__ = None; - let mut callbacks__ = 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::Callbacks => { - if callbacks__.is_some() { - return Err(serde::de::Error::duplicate_field("callbacks")); - } - callbacks__ = Some(map.next_value()?); - } - } - } - Ok(GenesisState { - params: params__, - callbacks: callbacks__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.callback.v1.GenesisState", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ModuleErrors { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::ErrUnknown => "ERR_UNKNOWN", - Self::ErrOutOfGas => "ERR_OUT_OF_GAS", - Self::ErrContractExecutionFailed => "ERR_CONTRACT_EXECUTION_FAILED", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for ModuleErrors { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "ERR_UNKNOWN", - "ERR_OUT_OF_GAS", - "ERR_CONTRACT_EXECUTION_FAILED", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ModuleErrors; - - 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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ModuleErrors::from_i32) - .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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ModuleErrors::from_i32) - .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 { - "ERR_UNKNOWN" => Ok(ModuleErrors::ErrUnknown), - "ERR_OUT_OF_GAS" => Ok(ModuleErrors::ErrOutOfGas), - "ERR_CONTRACT_EXECUTION_FAILED" => Ok(ModuleErrors::ErrContractExecutionFailed), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for MsgCancelCallback { - #[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_address.is_empty() { - len += 1; - } - if self.job_id != 0 { - len += 1; - } - if self.callback_height != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.callback.v1.MsgCancelCallback", len)?; - if !self.sender.is_empty() { - struct_ser.serialize_field("sender", &self.sender)?; - } - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - if self.job_id != 0 { - struct_ser.serialize_field("jobId", ToString::to_string(&self.job_id).as_str())?; - } - if self.callback_height != 0 { - struct_ser.serialize_field( - "callbackHeight", - ToString::to_string(&self.callback_height).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgCancelCallback { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "sender", - "contract_address", - "contractAddress", - "job_id", - "jobId", - "callback_height", - "callbackHeight", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Sender, - ContractAddress, - JobId, - CallbackHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "contractAddress" | "contract_address" => { - Ok(GeneratedField::ContractAddress) - } - "jobId" | "job_id" => Ok(GeneratedField::JobId), - "callbackHeight" | "callback_height" => { - Ok(GeneratedField::CallbackHeight) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgCancelCallback; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.callback.v1.MsgCancelCallback") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sender__ = None; - let mut contract_address__ = None; - let mut job_id__ = None; - let mut callback_height__ = 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::ContractAddress => { - if contract_address__.is_some() { - return Err(serde::de::Error::duplicate_field("contractAddress")); - } - contract_address__ = Some(map.next_value()?); - } - GeneratedField::JobId => { - if job_id__.is_some() { - return Err(serde::de::Error::duplicate_field("jobId")); - } - job_id__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::CallbackHeight => { - if callback_height__.is_some() { - return Err(serde::de::Error::duplicate_field("callbackHeight")); - } - callback_height__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(MsgCancelCallback { - sender: sender__.unwrap_or_default(), - contract_address: contract_address__.unwrap_or_default(), - job_id: job_id__.unwrap_or_default(), - callback_height: callback_height__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.callback.v1.MsgCancelCallback", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgCancelCallbackResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.refund.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.callback.v1.MsgCancelCallbackResponse", len)?; - if let Some(v) = self.refund.as_ref() { - struct_ser.serialize_field("refund", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgCancelCallbackResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["refund"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Refund, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "refund" => Ok(GeneratedField::Refund), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgCancelCallbackResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.callback.v1.MsgCancelCallbackResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut refund__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Refund => { - if refund__.is_some() { - return Err(serde::de::Error::duplicate_field("refund")); - } - refund__ = map.next_value()?; - } - } - } - Ok(MsgCancelCallbackResponse { refund: refund__ }) - } - } - deserializer.deserialize_struct( - "archway.callback.v1.MsgCancelCallbackResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgRequestCallback { - #[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_address.is_empty() { - len += 1; - } - if self.job_id != 0 { - len += 1; - } - if self.callback_height != 0 { - len += 1; - } - if self.fees.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.callback.v1.MsgRequestCallback", len)?; - if !self.sender.is_empty() { - struct_ser.serialize_field("sender", &self.sender)?; - } - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - if self.job_id != 0 { - struct_ser.serialize_field("jobId", ToString::to_string(&self.job_id).as_str())?; - } - if self.callback_height != 0 { - struct_ser.serialize_field( - "callbackHeight", - ToString::to_string(&self.callback_height).as_str(), - )?; - } - if let Some(v) = self.fees.as_ref() { - struct_ser.serialize_field("fees", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgRequestCallback { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "sender", - "contract_address", - "contractAddress", - "job_id", - "jobId", - "callback_height", - "callbackHeight", - "fees", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Sender, - ContractAddress, - JobId, - CallbackHeight, - Fees, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "contractAddress" | "contract_address" => { - Ok(GeneratedField::ContractAddress) - } - "jobId" | "job_id" => Ok(GeneratedField::JobId), - "callbackHeight" | "callback_height" => { - Ok(GeneratedField::CallbackHeight) - } - "fees" => Ok(GeneratedField::Fees), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgRequestCallback; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.callback.v1.MsgRequestCallback") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sender__ = None; - let mut contract_address__ = None; - let mut job_id__ = None; - let mut callback_height__ = None; - let mut fees__ = 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::ContractAddress => { - if contract_address__.is_some() { - return Err(serde::de::Error::duplicate_field("contractAddress")); - } - contract_address__ = Some(map.next_value()?); - } - GeneratedField::JobId => { - if job_id__.is_some() { - return Err(serde::de::Error::duplicate_field("jobId")); - } - job_id__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::CallbackHeight => { - if callback_height__.is_some() { - return Err(serde::de::Error::duplicate_field("callbackHeight")); - } - callback_height__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Fees => { - if fees__.is_some() { - return Err(serde::de::Error::duplicate_field("fees")); - } - fees__ = map.next_value()?; - } - } - } - Ok(MsgRequestCallback { - sender: sender__.unwrap_or_default(), - contract_address: contract_address__.unwrap_or_default(), - job_id: job_id__.unwrap_or_default(), - callback_height: callback_height__.unwrap_or_default(), - fees: fees__, - }) - } - } - deserializer.deserialize_struct( - "archway.callback.v1.MsgRequestCallback", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgRequestCallbackResponse { - #[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("archway.callback.v1.MsgRequestCallbackResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgRequestCallbackResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgRequestCallbackResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.callback.v1.MsgRequestCallbackResponse") - } - - 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(MsgRequestCallbackResponse {}) - } - } - deserializer.deserialize_struct( - "archway.callback.v1.MsgRequestCallbackResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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("archway.callback.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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 archway.callback.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( - "archway.callback.v1.MsgUpdateParams", - FIELDS, - GeneratedVisitor, - ) - } -} -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("archway.callback.v1.MsgUpdateParamsResponse", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 archway.callback.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( - "archway.callback.v1.MsgUpdateParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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.callback_gas_limit != 0 { - len += 1; - } - if self.max_block_reservation_limit != 0 { - len += 1; - } - if self.max_future_reservation_limit != 0 { - len += 1; - } - if !self.block_reservation_fee_multiplier.is_empty() { - len += 1; - } - if !self.future_reservation_fee_multiplier.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("archway.callback.v1.Params", len)?; - if self.callback_gas_limit != 0 { - struct_ser.serialize_field( - "callbackGasLimit", - ToString::to_string(&self.callback_gas_limit).as_str(), - )?; - } - if self.max_block_reservation_limit != 0 { - struct_ser.serialize_field( - "maxBlockReservationLimit", - ToString::to_string(&self.max_block_reservation_limit).as_str(), - )?; - } - if self.max_future_reservation_limit != 0 { - struct_ser.serialize_field( - "maxFutureReservationLimit", - ToString::to_string(&self.max_future_reservation_limit).as_str(), - )?; - } - if !self.block_reservation_fee_multiplier.is_empty() { - struct_ser.serialize_field( - "blockReservationFeeMultiplier", - &self.block_reservation_fee_multiplier, - )?; - } - if !self.future_reservation_fee_multiplier.is_empty() { - struct_ser.serialize_field( - "futureReservationFeeMultiplier", - &self.future_reservation_fee_multiplier, - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Params { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "callback_gas_limit", - "callbackGasLimit", - "max_block_reservation_limit", - "maxBlockReservationLimit", - "max_future_reservation_limit", - "maxFutureReservationLimit", - "block_reservation_fee_multiplier", - "blockReservationFeeMultiplier", - "future_reservation_fee_multiplier", - "futureReservationFeeMultiplier", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - CallbackGasLimit, - MaxBlockReservationLimit, - MaxFutureReservationLimit, - BlockReservationFeeMultiplier, - FutureReservationFeeMultiplier, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "callbackGasLimit" | "callback_gas_limit" => { - Ok(GeneratedField::CallbackGasLimit) - } - "maxBlockReservationLimit" | "max_block_reservation_limit" => { - Ok(GeneratedField::MaxBlockReservationLimit) - } - "maxFutureReservationLimit" | "max_future_reservation_limit" => { - Ok(GeneratedField::MaxFutureReservationLimit) - } - "blockReservationFeeMultiplier" - | "block_reservation_fee_multiplier" => { - Ok(GeneratedField::BlockReservationFeeMultiplier) - } - "futureReservationFeeMultiplier" - | "future_reservation_fee_multiplier" => { - Ok(GeneratedField::FutureReservationFeeMultiplier) - } - _ => 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 archway.callback.v1.Params") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut callback_gas_limit__ = None; - let mut max_block_reservation_limit__ = None; - let mut max_future_reservation_limit__ = None; - let mut block_reservation_fee_multiplier__ = None; - let mut future_reservation_fee_multiplier__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::CallbackGasLimit => { - if callback_gas_limit__.is_some() { - return Err(serde::de::Error::duplicate_field("callbackGasLimit")); - } - callback_gas_limit__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::MaxBlockReservationLimit => { - if max_block_reservation_limit__.is_some() { - return Err(serde::de::Error::duplicate_field( - "maxBlockReservationLimit", - )); - } - max_block_reservation_limit__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::MaxFutureReservationLimit => { - if max_future_reservation_limit__.is_some() { - return Err(serde::de::Error::duplicate_field( - "maxFutureReservationLimit", - )); - } - max_future_reservation_limit__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::BlockReservationFeeMultiplier => { - if block_reservation_fee_multiplier__.is_some() { - return Err(serde::de::Error::duplicate_field( - "blockReservationFeeMultiplier", - )); - } - block_reservation_fee_multiplier__ = Some(map.next_value()?); - } - GeneratedField::FutureReservationFeeMultiplier => { - if future_reservation_fee_multiplier__.is_some() { - return Err(serde::de::Error::duplicate_field( - "futureReservationFeeMultiplier", - )); - } - future_reservation_fee_multiplier__ = Some(map.next_value()?); - } - } - } - Ok(Params { - callback_gas_limit: callback_gas_limit__.unwrap_or_default(), - max_block_reservation_limit: max_block_reservation_limit__.unwrap_or_default(), - max_future_reservation_limit: max_future_reservation_limit__ - .unwrap_or_default(), - block_reservation_fee_multiplier: block_reservation_fee_multiplier__ - .unwrap_or_default(), - future_reservation_fee_multiplier: future_reservation_fee_multiplier__ - .unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("archway.callback.v1.Params", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryCallbacksRequest { - #[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; - } - let mut struct_ser = - serializer.serialize_struct("archway.callback.v1.QueryCallbacksRequest", len)?; - if self.block_height != 0 { - struct_ser.serialize_field( - "blockHeight", - ToString::to_string(&self.block_height).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryCallbacksRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["block_height", "blockHeight"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - BlockHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryCallbacksRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.callback.v1.QueryCallbacksRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut block_height__ = 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, - ); - } - } - } - Ok(QueryCallbacksRequest { - block_height: block_height__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.callback.v1.QueryCallbacksRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryCallbacksResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.callbacks.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.callback.v1.QueryCallbacksResponse", len)?; - if !self.callbacks.is_empty() { - struct_ser.serialize_field("callbacks", &self.callbacks)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryCallbacksResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["callbacks"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Callbacks, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "callbacks" => Ok(GeneratedField::Callbacks), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryCallbacksResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.callback.v1.QueryCallbacksResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut callbacks__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Callbacks => { - if callbacks__.is_some() { - return Err(serde::de::Error::duplicate_field("callbacks")); - } - callbacks__ = Some(map.next_value()?); - } - } - } - Ok(QueryCallbacksResponse { - callbacks: callbacks__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.callback.v1.QueryCallbacksResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryEstimateCallbackFeesRequest { - #[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; - } - let mut struct_ser = serializer - .serialize_struct("archway.callback.v1.QueryEstimateCallbackFeesRequest", len)?; - if self.block_height != 0 { - struct_ser.serialize_field( - "blockHeight", - ToString::to_string(&self.block_height).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryEstimateCallbackFeesRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["block_height", "blockHeight"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - BlockHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryEstimateCallbackFeesRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.callback.v1.QueryEstimateCallbackFeesRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut block_height__ = 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, - ); - } - } - } - Ok(QueryEstimateCallbackFeesRequest { - block_height: block_height__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.callback.v1.QueryEstimateCallbackFeesRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryEstimateCallbackFeesResponse { - #[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_fees.is_some() { - len += 1; - } - if self.fee_split.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("archway.callback.v1.QueryEstimateCallbackFeesResponse", len)?; - if let Some(v) = self.total_fees.as_ref() { - struct_ser.serialize_field("totalFees", v)?; - } - if let Some(v) = self.fee_split.as_ref() { - struct_ser.serialize_field("feeSplit", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryEstimateCallbackFeesResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["total_fees", "totalFees", "fee_split", "feeSplit"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - TotalFees, - FeeSplit, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "totalFees" | "total_fees" => Ok(GeneratedField::TotalFees), - "feeSplit" | "fee_split" => Ok(GeneratedField::FeeSplit), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryEstimateCallbackFeesResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.callback.v1.QueryEstimateCallbackFeesResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut total_fees__ = None; - let mut fee_split__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::TotalFees => { - if total_fees__.is_some() { - return Err(serde::de::Error::duplicate_field("totalFees")); - } - total_fees__ = map.next_value()?; - } - GeneratedField::FeeSplit => { - if fee_split__.is_some() { - return Err(serde::de::Error::duplicate_field("feeSplit")); - } - fee_split__ = map.next_value()?; - } - } - } - Ok(QueryEstimateCallbackFeesResponse { - total_fees: total_fees__, - fee_split: fee_split__, - }) - } - } - deserializer.deserialize_struct( - "archway.callback.v1.QueryEstimateCallbackFeesResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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("archway.callback.v1.QueryParamsRequest", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 archway.callback.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( - "archway.callback.v1.QueryParamsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -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("archway.callback.v1.QueryParamsResponse", len)?; - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["params"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 archway.callback.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( - "archway.callback.v1.QueryParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/archway.cwerrors.v1.rs b/packages/proto/src/gen/archway.cwerrors.v1.rs index 45204e7..6536939 100644 --- a/packages/proto/src/gen/archway.cwerrors.v1.rs +++ b/packages/proto/src/gen/archway.cwerrors.v1.rs @@ -1,5 +1,6 @@ // @generated /// SudoError defines the sudo message for the error callback +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SudoError { @@ -28,7 +29,19 @@ impl ::prost::Name for SudoError { } } /// ModuleErrors defines the module level error codes -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum ModuleErrors { /// ERR_UNKNOWN is the default error code @@ -57,6 +70,7 @@ impl ModuleErrors { } } /// Params defines the set of parameters for the cwerrors module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -79,6 +93,7 @@ impl ::prost::Name for Params { } /// ParamsUpdatedEvent defines the event which is thrown when the module /// parameters are updated +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ParamsUpdatedEvent { @@ -98,6 +113,7 @@ impl ::prost::Name for ParamsUpdatedEvent { } /// SubscribedToErrorsEvent defines the event which is thrown when a contract /// subscribes to errors +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SubscribedToErrorsEvent { @@ -124,6 +140,7 @@ impl ::prost::Name for SubscribedToErrorsEvent { } } /// StoringErrorEvent defines the event which is thrown when an error is stored +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StoringErrorEvent { @@ -144,6 +161,7 @@ impl ::prost::Name for StoringErrorEvent { } /// SudoErrorCallbackFailedEvent defines the event which is thrown when a sudo /// error callback fails +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SudoErrorCallbackFailedEvent { @@ -162,6 +180,7 @@ impl ::prost::Name for SudoErrorCallbackFailedEvent { } } /// GenesisState defines the cwerrors module's genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -180,6 +199,7 @@ impl ::prost::Name for GenesisState { } } /// QueryParamsRequest is the request for Query.Params. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} @@ -191,6 +211,7 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse is the response for Query.Params. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -206,6 +227,7 @@ impl ::prost::Name for QueryParamsResponse { } } /// QueryErrorsRequest is the request for Query.Errors. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryErrorsRequest { @@ -221,6 +243,7 @@ impl ::prost::Name for QueryErrorsRequest { } } /// QueryErrorsResponse is the response for Query.Errors. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryErrorsResponse { @@ -236,6 +259,7 @@ impl ::prost::Name for QueryErrorsResponse { } } /// QueryIsSubscribedRequest is the request for Query.IsSubscribed. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryIsSubscribedRequest { @@ -251,6 +275,7 @@ impl ::prost::Name for QueryIsSubscribedRequest { } } /// QueryIsSubscribedResponse is the response for Query.IsSubscribed. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryIsSubscribedResponse { @@ -270,6 +295,7 @@ impl ::prost::Name for QueryIsSubscribedResponse { } } /// MsgUpdateParams is the Msg/UpdateParams request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -292,6 +318,7 @@ impl ::prost::Name for MsgUpdateParams { } /// MsgUpdateParamsResponse defines the response structure for executing a /// MsgUpdateParams message. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} @@ -303,6 +330,7 @@ impl ::prost::Name for MsgUpdateParamsResponse { } } /// MsgSubscribeToError is the Msg/SubscribeToError request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubscribeToError { @@ -327,6 +355,7 @@ impl ::prost::Name for MsgSubscribeToError { } /// MsgSubscribeToErrorResponse defines the response structure for executing a /// MsgSubscribeToError message. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubscribeToErrorResponse { @@ -1085,6 +1114,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x0a, 0x05, 0x04, 0x03, 0x02, 0x00, 0x03, 0x12, 0x03, 0x3a, 0x22, 0x23, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("archway.cwerrors.v1.serde.rs"); include!("archway.cwerrors.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/archway.cwerrors.v1.serde.rs b/packages/proto/src/gen/archway.cwerrors.v1.serde.rs deleted file mode 100644 index fdec8a6..0000000 --- a/packages/proto/src/gen/archway.cwerrors.v1.serde.rs +++ /dev/null @@ -1,2063 +0,0 @@ -// @generated -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.errors.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.cwerrors.v1.GenesisState", len)?; - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - if !self.errors.is_empty() { - struct_ser.serialize_field("errors", &self.errors)?; - } - struct_ser.end() - } -} -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", "errors"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - Errors, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "errors" => Ok(GeneratedField::Errors), - _ => 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 archway.cwerrors.v1.GenesisState") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut params__ = None; - let mut errors__ = 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::Errors => { - if errors__.is_some() { - return Err(serde::de::Error::duplicate_field("errors")); - } - errors__ = Some(map.next_value()?); - } - } - } - Ok(GenesisState { - params: params__, - errors: errors__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.cwerrors.v1.GenesisState", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ModuleErrors { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::ErrUnknown => "ERR_UNKNOWN", - Self::ErrCallbackExecutionFailed => "ERR_CALLBACK_EXECUTION_FAILED", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for ModuleErrors { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["ERR_UNKNOWN", "ERR_CALLBACK_EXECUTION_FAILED"]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ModuleErrors; - - 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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ModuleErrors::from_i32) - .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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ModuleErrors::from_i32) - .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 { - "ERR_UNKNOWN" => Ok(ModuleErrors::ErrUnknown), - "ERR_CALLBACK_EXECUTION_FAILED" => Ok(ModuleErrors::ErrCallbackExecutionFailed), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for MsgSubscribeToError { - #[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_address.is_empty() { - len += 1; - } - if self.fee.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.cwerrors.v1.MsgSubscribeToError", len)?; - if !self.sender.is_empty() { - struct_ser.serialize_field("sender", &self.sender)?; - } - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - if let Some(v) = self.fee.as_ref() { - struct_ser.serialize_field("fee", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSubscribeToError { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["sender", "contract_address", "contractAddress", "fee"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Sender, - ContractAddress, - Fee, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "contractAddress" | "contract_address" => { - Ok(GeneratedField::ContractAddress) - } - "fee" => Ok(GeneratedField::Fee), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSubscribeToError; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwerrors.v1.MsgSubscribeToError") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sender__ = None; - let mut contract_address__ = None; - let mut fee__ = 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::ContractAddress => { - if contract_address__.is_some() { - return Err(serde::de::Error::duplicate_field("contractAddress")); - } - contract_address__ = Some(map.next_value()?); - } - GeneratedField::Fee => { - if fee__.is_some() { - return Err(serde::de::Error::duplicate_field("fee")); - } - fee__ = map.next_value()?; - } - } - } - Ok(MsgSubscribeToError { - sender: sender__.unwrap_or_default(), - contract_address: contract_address__.unwrap_or_default(), - fee: fee__, - }) - } - } - deserializer.deserialize_struct( - "archway.cwerrors.v1.MsgSubscribeToError", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgSubscribeToErrorResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.subscription_valid_till != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.cwerrors.v1.MsgSubscribeToErrorResponse", len)?; - if self.subscription_valid_till != 0 { - struct_ser.serialize_field( - "subscriptionValidTill", - ToString::to_string(&self.subscription_valid_till).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSubscribeToErrorResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["subscription_valid_till", "subscriptionValidTill"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SubscriptionValidTill, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "subscriptionValidTill" | "subscription_valid_till" => { - Ok(GeneratedField::SubscriptionValidTill) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSubscribeToErrorResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwerrors.v1.MsgSubscribeToErrorResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut subscription_valid_till__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::SubscriptionValidTill => { - if subscription_valid_till__.is_some() { - return Err(serde::de::Error::duplicate_field( - "subscriptionValidTill", - )); - } - subscription_valid_till__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(MsgSubscribeToErrorResponse { - subscription_valid_till: subscription_valid_till__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.cwerrors.v1.MsgSubscribeToErrorResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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("archway.cwerrors.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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 archway.cwerrors.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( - "archway.cwerrors.v1.MsgUpdateParams", - FIELDS, - GeneratedVisitor, - ) - } -} -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("archway.cwerrors.v1.MsgUpdateParamsResponse", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 archway.cwerrors.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( - "archway.cwerrors.v1.MsgUpdateParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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.error_stored_time != 0 { - len += 1; - } - if self.subscription_fee.is_some() { - len += 1; - } - if self.subscription_period != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("archway.cwerrors.v1.Params", len)?; - if self.error_stored_time != 0 { - struct_ser.serialize_field( - "errorStoredTime", - ToString::to_string(&self.error_stored_time).as_str(), - )?; - } - if let Some(v) = self.subscription_fee.as_ref() { - struct_ser.serialize_field("subscriptionFee", v)?; - } - if self.subscription_period != 0 { - struct_ser.serialize_field( - "subscriptionPeriod", - ToString::to_string(&self.subscription_period).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Params { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "error_stored_time", - "errorStoredTime", - "subscription_fee", - "subscriptionFee", - "subscription_period", - "subscriptionPeriod", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ErrorStoredTime, - SubscriptionFee, - SubscriptionPeriod, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "errorStoredTime" | "error_stored_time" => { - Ok(GeneratedField::ErrorStoredTime) - } - "subscriptionFee" | "subscription_fee" => { - Ok(GeneratedField::SubscriptionFee) - } - "subscriptionPeriod" | "subscription_period" => { - Ok(GeneratedField::SubscriptionPeriod) - } - _ => 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 archway.cwerrors.v1.Params") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut error_stored_time__ = None; - let mut subscription_fee__ = None; - let mut subscription_period__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ErrorStoredTime => { - if error_stored_time__.is_some() { - return Err(serde::de::Error::duplicate_field("errorStoredTime")); - } - error_stored_time__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::SubscriptionFee => { - if subscription_fee__.is_some() { - return Err(serde::de::Error::duplicate_field("subscriptionFee")); - } - subscription_fee__ = map.next_value()?; - } - GeneratedField::SubscriptionPeriod => { - if subscription_period__.is_some() { - return Err(serde::de::Error::duplicate_field( - "subscriptionPeriod", - )); - } - subscription_period__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(Params { - error_stored_time: error_stored_time__.unwrap_or_default(), - subscription_fee: subscription_fee__, - subscription_period: subscription_period__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("archway.cwerrors.v1.Params", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ParamsUpdatedEvent { - #[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_params.is_some() { - len += 1; - } - if !self.authority.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.cwerrors.v1.ParamsUpdatedEvent", len)?; - if let Some(v) = self.new_params.as_ref() { - struct_ser.serialize_field("newParams", v)?; - } - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ParamsUpdatedEvent { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["new_params", "newParams", "authority"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - NewParams, - Authority, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "newParams" | "new_params" => Ok(GeneratedField::NewParams), - "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 = ParamsUpdatedEvent; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwerrors.v1.ParamsUpdatedEvent") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut new_params__ = None; - let mut authority__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::NewParams => { - if new_params__.is_some() { - return Err(serde::de::Error::duplicate_field("newParams")); - } - new_params__ = map.next_value()?; - } - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map.next_value()?); - } - } - } - Ok(ParamsUpdatedEvent { - new_params: new_params__, - authority: authority__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.cwerrors.v1.ParamsUpdatedEvent", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryErrorsRequest { - #[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; - } - let mut struct_ser = - serializer.serialize_struct("archway.cwerrors.v1.QueryErrorsRequest", len)?; - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryErrorsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["contract_address", "contractAddress"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ContractAddress, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryErrorsRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwerrors.v1.QueryErrorsRequest") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut contract_address__ = 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()?); - } - } - } - Ok(QueryErrorsRequest { - contract_address: contract_address__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.cwerrors.v1.QueryErrorsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryErrorsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.errors.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.cwerrors.v1.QueryErrorsResponse", len)?; - if !self.errors.is_empty() { - struct_ser.serialize_field("errors", &self.errors)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryErrorsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["errors"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Errors, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "errors" => Ok(GeneratedField::Errors), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryErrorsResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwerrors.v1.QueryErrorsResponse") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut errors__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Errors => { - if errors__.is_some() { - return Err(serde::de::Error::duplicate_field("errors")); - } - errors__ = Some(map.next_value()?); - } - } - } - Ok(QueryErrorsResponse { - errors: errors__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.cwerrors.v1.QueryErrorsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryIsSubscribedRequest { - #[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; - } - let mut struct_ser = - serializer.serialize_struct("archway.cwerrors.v1.QueryIsSubscribedRequest", len)?; - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryIsSubscribedRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["contract_address", "contractAddress"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ContractAddress, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryIsSubscribedRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwerrors.v1.QueryIsSubscribedRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut contract_address__ = 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()?); - } - } - } - Ok(QueryIsSubscribedRequest { - contract_address: contract_address__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.cwerrors.v1.QueryIsSubscribedRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryIsSubscribedResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.subscribed { - len += 1; - } - if self.subscription_valid_till != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.cwerrors.v1.QueryIsSubscribedResponse", len)?; - if self.subscribed { - struct_ser.serialize_field("subscribed", &self.subscribed)?; - } - if self.subscription_valid_till != 0 { - struct_ser.serialize_field( - "subscriptionValidTill", - ToString::to_string(&self.subscription_valid_till).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryIsSubscribedResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "subscribed", - "subscription_valid_till", - "subscriptionValidTill", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Subscribed, - SubscriptionValidTill, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "subscribed" => Ok(GeneratedField::Subscribed), - "subscriptionValidTill" | "subscription_valid_till" => { - Ok(GeneratedField::SubscriptionValidTill) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryIsSubscribedResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwerrors.v1.QueryIsSubscribedResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut subscribed__ = None; - let mut subscription_valid_till__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Subscribed => { - if subscribed__.is_some() { - return Err(serde::de::Error::duplicate_field("subscribed")); - } - subscribed__ = Some(map.next_value()?); - } - GeneratedField::SubscriptionValidTill => { - if subscription_valid_till__.is_some() { - return Err(serde::de::Error::duplicate_field( - "subscriptionValidTill", - )); - } - subscription_valid_till__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(QueryIsSubscribedResponse { - subscribed: subscribed__.unwrap_or_default(), - subscription_valid_till: subscription_valid_till__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.cwerrors.v1.QueryIsSubscribedResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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("archway.cwerrors.v1.QueryParamsRequest", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 archway.cwerrors.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( - "archway.cwerrors.v1.QueryParamsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -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("archway.cwerrors.v1.QueryParamsResponse", len)?; - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["params"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 archway.cwerrors.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( - "archway.cwerrors.v1.QueryParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for StoringErrorEvent { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.error.is_some() { - len += 1; - } - if self.deletion_block_height != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.cwerrors.v1.StoringErrorEvent", len)?; - if let Some(v) = self.error.as_ref() { - struct_ser.serialize_field("error", v)?; - } - if self.deletion_block_height != 0 { - struct_ser.serialize_field( - "deletionBlockHeight", - ToString::to_string(&self.deletion_block_height).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for StoringErrorEvent { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["error", "deletion_block_height", "deletionBlockHeight"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Error, - DeletionBlockHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "error" => Ok(GeneratedField::Error), - "deletionBlockHeight" | "deletion_block_height" => { - Ok(GeneratedField::DeletionBlockHeight) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StoringErrorEvent; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwerrors.v1.StoringErrorEvent") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut error__ = None; - let mut deletion_block_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Error => { - if error__.is_some() { - return Err(serde::de::Error::duplicate_field("error")); - } - error__ = map.next_value()?; - } - GeneratedField::DeletionBlockHeight => { - if deletion_block_height__.is_some() { - return Err(serde::de::Error::duplicate_field( - "deletionBlockHeight", - )); - } - deletion_block_height__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(StoringErrorEvent { - error: error__, - deletion_block_height: deletion_block_height__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.cwerrors.v1.StoringErrorEvent", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for SubscribedToErrorsEvent { - #[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_address.is_empty() { - len += 1; - } - if self.fees_paid.is_some() { - len += 1; - } - if self.subscription_valid_till != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.cwerrors.v1.SubscribedToErrorsEvent", len)?; - if !self.sender.is_empty() { - struct_ser.serialize_field("sender", &self.sender)?; - } - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - if let Some(v) = self.fees_paid.as_ref() { - struct_ser.serialize_field("feesPaid", v)?; - } - if self.subscription_valid_till != 0 { - struct_ser.serialize_field( - "subscriptionValidTill", - ToString::to_string(&self.subscription_valid_till).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SubscribedToErrorsEvent { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "sender", - "contract_address", - "contractAddress", - "fees_paid", - "feesPaid", - "subscription_valid_till", - "subscriptionValidTill", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Sender, - ContractAddress, - FeesPaid, - SubscriptionValidTill, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "contractAddress" | "contract_address" => { - Ok(GeneratedField::ContractAddress) - } - "feesPaid" | "fees_paid" => Ok(GeneratedField::FeesPaid), - "subscriptionValidTill" | "subscription_valid_till" => { - Ok(GeneratedField::SubscriptionValidTill) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SubscribedToErrorsEvent; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwerrors.v1.SubscribedToErrorsEvent") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sender__ = None; - let mut contract_address__ = None; - let mut fees_paid__ = None; - let mut subscription_valid_till__ = 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::ContractAddress => { - if contract_address__.is_some() { - return Err(serde::de::Error::duplicate_field("contractAddress")); - } - contract_address__ = Some(map.next_value()?); - } - GeneratedField::FeesPaid => { - if fees_paid__.is_some() { - return Err(serde::de::Error::duplicate_field("feesPaid")); - } - fees_paid__ = map.next_value()?; - } - GeneratedField::SubscriptionValidTill => { - if subscription_valid_till__.is_some() { - return Err(serde::de::Error::duplicate_field( - "subscriptionValidTill", - )); - } - subscription_valid_till__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(SubscribedToErrorsEvent { - sender: sender__.unwrap_or_default(), - contract_address: contract_address__.unwrap_or_default(), - fees_paid: fees_paid__, - subscription_valid_till: subscription_valid_till__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.cwerrors.v1.SubscribedToErrorsEvent", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for SudoError { - #[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.error_code != 0 { - len += 1; - } - if !self.contract_address.is_empty() { - len += 1; - } - if !self.input_payload.is_empty() { - len += 1; - } - if !self.error_message.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("archway.cwerrors.v1.SudoError", len)?; - if !self.module_name.is_empty() { - struct_ser.serialize_field("moduleName", &self.module_name)?; - } - if self.error_code != 0 { - struct_ser.serialize_field("errorCode", &self.error_code)?; - } - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - if !self.input_payload.is_empty() { - struct_ser.serialize_field("inputPayload", &self.input_payload)?; - } - if !self.error_message.is_empty() { - struct_ser.serialize_field("errorMessage", &self.error_message)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SudoError { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "module_name", - "moduleName", - "error_code", - "errorCode", - "contract_address", - "contractAddress", - "input_payload", - "inputPayload", - "error_message", - "errorMessage", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ModuleName, - ErrorCode, - ContractAddress, - InputPayload, - ErrorMessage, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "errorCode" | "error_code" => Ok(GeneratedField::ErrorCode), - "contractAddress" | "contract_address" => { - Ok(GeneratedField::ContractAddress) - } - "inputPayload" | "input_payload" => Ok(GeneratedField::InputPayload), - "errorMessage" | "error_message" => Ok(GeneratedField::ErrorMessage), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SudoError; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwerrors.v1.SudoError") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut module_name__ = None; - let mut error_code__ = None; - let mut contract_address__ = None; - let mut input_payload__ = None; - let mut error_message__ = 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::ErrorCode => { - if error_code__.is_some() { - return Err(serde::de::Error::duplicate_field("errorCode")); - } - error_code__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::ContractAddress => { - if contract_address__.is_some() { - return Err(serde::de::Error::duplicate_field("contractAddress")); - } - contract_address__ = Some(map.next_value()?); - } - GeneratedField::InputPayload => { - if input_payload__.is_some() { - return Err(serde::de::Error::duplicate_field("inputPayload")); - } - input_payload__ = Some(map.next_value()?); - } - GeneratedField::ErrorMessage => { - if error_message__.is_some() { - return Err(serde::de::Error::duplicate_field("errorMessage")); - } - error_message__ = Some(map.next_value()?); - } - } - } - Ok(SudoError { - module_name: module_name__.unwrap_or_default(), - error_code: error_code__.unwrap_or_default(), - contract_address: contract_address__.unwrap_or_default(), - input_payload: input_payload__.unwrap_or_default(), - error_message: error_message__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("archway.cwerrors.v1.SudoError", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SudoErrorCallbackFailedEvent { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.error.is_some() { - len += 1; - } - if !self.callback_error_message.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.cwerrors.v1.SudoErrorCallbackFailedEvent", len)?; - if let Some(v) = self.error.as_ref() { - struct_ser.serialize_field("error", v)?; - } - if !self.callback_error_message.is_empty() { - struct_ser.serialize_field("callbackErrorMessage", &self.callback_error_message)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SudoErrorCallbackFailedEvent { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["error", "callback_error_message", "callbackErrorMessage"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Error, - CallbackErrorMessage, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "error" => Ok(GeneratedField::Error), - "callbackErrorMessage" | "callback_error_message" => { - Ok(GeneratedField::CallbackErrorMessage) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SudoErrorCallbackFailedEvent; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwerrors.v1.SudoErrorCallbackFailedEvent") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut error__ = None; - let mut callback_error_message__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Error => { - if error__.is_some() { - return Err(serde::de::Error::duplicate_field("error")); - } - error__ = map.next_value()?; - } - GeneratedField::CallbackErrorMessage => { - if callback_error_message__.is_some() { - return Err(serde::de::Error::duplicate_field( - "callbackErrorMessage", - )); - } - callback_error_message__ = Some(map.next_value()?); - } - } - } - Ok(SudoErrorCallbackFailedEvent { - error: error__, - callback_error_message: callback_error_message__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.cwerrors.v1.SudoErrorCallbackFailedEvent", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/archway.cwfees.v1.rs b/packages/proto/src/gen/archway.cwfees.v1.rs index f983824..074a289 100644 --- a/packages/proto/src/gen/archway.cwfees.v1.rs +++ b/packages/proto/src/gen/archway.cwfees.v1.rs @@ -1,5 +1,6 @@ // @generated /// MsgRegisterAsGranter allows a contract to register itself as a fee granter. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRegisterAsGranter { @@ -14,6 +15,7 @@ impl ::prost::Name for MsgRegisterAsGranter { } } /// MsgRegisterAsGranterResponse defines the response of RegisterAsGranter. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRegisterAsGranterResponse {} @@ -25,6 +27,7 @@ impl ::prost::Name for MsgRegisterAsGranterResponse { } } /// MsgUnregisterAsGranter can be used by a cosmwasm contract to unregister itself as a fee granter. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUnregisterAsGranter { @@ -39,6 +42,7 @@ impl ::prost::Name for MsgUnregisterAsGranter { } } /// MsgUnregisterAsGranterResponse defines the response of UnregisterAsGranter. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUnregisterAsGranterResponse {} @@ -50,6 +54,7 @@ impl ::prost::Name for MsgUnregisterAsGranterResponse { } } /// IsGrantingContract is the request type of IsGrantingContract RPC. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IsGrantingContractRequest { @@ -66,6 +71,7 @@ impl ::prost::Name for IsGrantingContractRequest { } } /// IsGrantingContractResponse is the response type of IsGRantingContract RPC. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IsGrantingContractResponse { @@ -81,6 +87,7 @@ impl ::prost::Name for IsGrantingContractResponse { } } /// GenesisState represents the genesis state of the cwfeesant module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -273,6 +280,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x12, 0x24, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x06, 0x02, 0x00, 0x03, 0x12, 0x03, 0x37, 0x27, 0x28, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("archway.cwfees.v1.serde.rs"); include!("archway.cwfees.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/archway.cwfees.v1.serde.rs b/packages/proto/src/gen/archway.cwfees.v1.serde.rs deleted file mode 100644 index e39ffe0..0000000 --- a/packages/proto/src/gen/archway.cwfees.v1.serde.rs +++ /dev/null @@ -1,660 +0,0 @@ -// @generated -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.granting_contracts.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("archway.cwfees.v1.GenesisState", len)?; - if !self.granting_contracts.is_empty() { - struct_ser.serialize_field("grantingContracts", &self.granting_contracts)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GenesisState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["granting_contracts", "grantingContracts"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - GrantingContracts, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "grantingContracts" | "granting_contracts" => { - Ok(GeneratedField::GrantingContracts) - } - _ => 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 archway.cwfees.v1.GenesisState") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut granting_contracts__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::GrantingContracts => { - if granting_contracts__.is_some() { - return Err(serde::de::Error::duplicate_field("grantingContracts")); - } - granting_contracts__ = Some(map.next_value()?); - } - } - } - Ok(GenesisState { - granting_contracts: granting_contracts__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("archway.cwfees.v1.GenesisState", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for IsGrantingContractRequest { - #[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; - } - let mut struct_ser = - serializer.serialize_struct("archway.cwfees.v1.IsGrantingContractRequest", len)?; - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for IsGrantingContractRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["contract_address", "contractAddress"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ContractAddress, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IsGrantingContractRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwfees.v1.IsGrantingContractRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut contract_address__ = 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()?); - } - } - } - Ok(IsGrantingContractRequest { - contract_address: contract_address__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.cwfees.v1.IsGrantingContractRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for IsGrantingContractResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.is_granting_contract { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.cwfees.v1.IsGrantingContractResponse", len)?; - if self.is_granting_contract { - struct_ser.serialize_field("isGrantingContract", &self.is_granting_contract)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for IsGrantingContractResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["is_granting_contract", "isGrantingContract"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - IsGrantingContract, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "isGrantingContract" | "is_granting_contract" => { - Ok(GeneratedField::IsGrantingContract) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IsGrantingContractResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwfees.v1.IsGrantingContractResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut is_granting_contract__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::IsGrantingContract => { - if is_granting_contract__.is_some() { - return Err(serde::de::Error::duplicate_field( - "isGrantingContract", - )); - } - is_granting_contract__ = Some(map.next_value()?); - } - } - } - Ok(IsGrantingContractResponse { - is_granting_contract: is_granting_contract__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.cwfees.v1.IsGrantingContractResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgRegisterAsGranter { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.granting_contract.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.cwfees.v1.MsgRegisterAsGranter", len)?; - if !self.granting_contract.is_empty() { - struct_ser.serialize_field("grantingContract", &self.granting_contract)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgRegisterAsGranter { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["granting_contract", "grantingContract"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - GrantingContract, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "grantingContract" | "granting_contract" => { - Ok(GeneratedField::GrantingContract) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgRegisterAsGranter; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwfees.v1.MsgRegisterAsGranter") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut granting_contract__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::GrantingContract => { - if granting_contract__.is_some() { - return Err(serde::de::Error::duplicate_field("grantingContract")); - } - granting_contract__ = Some(map.next_value()?); - } - } - } - Ok(MsgRegisterAsGranter { - granting_contract: granting_contract__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.cwfees.v1.MsgRegisterAsGranter", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgRegisterAsGranterResponse { - #[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("archway.cwfees.v1.MsgRegisterAsGranterResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgRegisterAsGranterResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgRegisterAsGranterResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwfees.v1.MsgRegisterAsGranterResponse") - } - - 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(MsgRegisterAsGranterResponse {}) - } - } - deserializer.deserialize_struct( - "archway.cwfees.v1.MsgRegisterAsGranterResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgUnregisterAsGranter { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.granting_contract.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.cwfees.v1.MsgUnregisterAsGranter", len)?; - if !self.granting_contract.is_empty() { - struct_ser.serialize_field("grantingContract", &self.granting_contract)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUnregisterAsGranter { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["granting_contract", "grantingContract"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - GrantingContract, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "grantingContract" | "granting_contract" => { - Ok(GeneratedField::GrantingContract) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgUnregisterAsGranter; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwfees.v1.MsgUnregisterAsGranter") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut granting_contract__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::GrantingContract => { - if granting_contract__.is_some() { - return Err(serde::de::Error::duplicate_field("grantingContract")); - } - granting_contract__ = Some(map.next_value()?); - } - } - } - Ok(MsgUnregisterAsGranter { - granting_contract: granting_contract__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.cwfees.v1.MsgUnregisterAsGranter", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgUnregisterAsGranterResponse { - #[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("archway.cwfees.v1.MsgUnregisterAsGranterResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUnregisterAsGranterResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgUnregisterAsGranterResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwfees.v1.MsgUnregisterAsGranterResponse") - } - - 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(MsgUnregisterAsGranterResponse {}) - } - } - deserializer.deserialize_struct( - "archway.cwfees.v1.MsgUnregisterAsGranterResponse", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/archway.cwica.v1.rs b/packages/proto/src/gen/archway.cwica.v1.rs index f18fa8e..e29c3e2 100644 --- a/packages/proto/src/gen/archway.cwica.v1.rs +++ b/packages/proto/src/gen/archway.cwica.v1.rs @@ -1,6 +1,18 @@ // @generated /// ModuleErrors defines the module level error codes -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum ModuleErrors { /// ERR_UNKNOWN is the default error code @@ -33,6 +45,7 @@ impl ModuleErrors { } } /// Params defines the parameters for the module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -48,6 +61,7 @@ impl ::prost::Name for Params { } } /// GenesisState defines the cwica module's genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -63,6 +77,7 @@ impl ::prost::Name for GenesisState { } } /// QueryParamsRequest is request type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} @@ -74,6 +89,7 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse is response type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -90,6 +106,7 @@ impl ::prost::Name for QueryParamsResponse { } /// Sudopayload is the payload for the sudo call sent by the cwica module on IBC /// actions +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SudoPayload { @@ -105,6 +122,7 @@ impl ::prost::Name for SudoPayload { } } /// ICASuccess is the success message after the ICA operation has taken place +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IcaSuccess { @@ -126,6 +144,7 @@ impl ::prost::Name for IcaSuccess { } /// AccountRegistered is contains the address of the registered account on the /// counterparty chain +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AccountRegistered { @@ -142,6 +161,7 @@ impl ::prost::Name for AccountRegistered { } } /// TxExecuted is the response message after the execute of the ICA tx +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxExecuted { @@ -161,6 +181,7 @@ impl ::prost::Name for TxExecuted { } /// MsgRegisterInterchainAccount defines the Msg/RegisterInterchainAccount /// request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRegisterInterchainAccount { @@ -181,6 +202,7 @@ impl ::prost::Name for MsgRegisterInterchainAccount { } /// MsgRegisterInterchainAccountResponse defines the response for /// Msg/RegisterInterchainAccount +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRegisterInterchainAccountResponse {} @@ -192,6 +214,7 @@ impl ::prost::Name for MsgRegisterInterchainAccountResponse { } } /// MsgSendTx defines the Msg/SendTx request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSendTx { @@ -220,6 +243,7 @@ impl ::prost::Name for MsgSendTx { } } /// MsgSendTxResponse defines the response for Msg/SendTx +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSendTxResponse { @@ -239,6 +263,7 @@ impl ::prost::Name for MsgSendTxResponse { } } /// MsgUpdateParams is the MsgUpdateParams request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -259,6 +284,7 @@ impl ::prost::Name for MsgUpdateParams { } } /// MsgUpdateParamsResponse is the MsgUpdateParams response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} @@ -834,6 +860,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x0a, 0x0a, 0x0a, 0x0a, 0x03, 0x04, 0x05, 0x01, 0x12, 0x03, 0x56, 0x08, 0x1f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("archway.cwica.v1.serde.rs"); include!("archway.cwica.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/archway.cwica.v1.serde.rs b/packages/proto/src/gen/archway.cwica.v1.serde.rs deleted file mode 100644 index da11f0b..0000000 --- a/packages/proto/src/gen/archway.cwica.v1.serde.rs +++ /dev/null @@ -1,1535 +0,0 @@ -// @generated -impl serde::Serialize for AccountRegistered { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.counterparty_address.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.cwica.v1.AccountRegistered", len)?; - if !self.counterparty_address.is_empty() { - struct_ser.serialize_field("counterpartyAddress", &self.counterparty_address)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for AccountRegistered { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["counterparty_address", "counterpartyAddress"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - CounterpartyAddress, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "counterpartyAddress" | "counterparty_address" => { - Ok(GeneratedField::CounterpartyAddress) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = AccountRegistered; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwica.v1.AccountRegistered") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut counterparty_address__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::CounterpartyAddress => { - if counterparty_address__.is_some() { - return Err(serde::de::Error::duplicate_field( - "counterpartyAddress", - )); - } - counterparty_address__ = Some(map.next_value()?); - } - } - } - Ok(AccountRegistered { - counterparty_address: counterparty_address__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.cwica.v1.AccountRegistered", - FIELDS, - GeneratedVisitor, - ) - } -} -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("archway.cwica.v1.GenesisState", len)?; - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GenesisState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["params"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 archway.cwica.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("archway.cwica.v1.GenesisState", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for IcaSuccess { - #[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_registered.is_some() { - len += 1; - } - if self.tx_executed.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("archway.cwica.v1.ICASuccess", len)?; - if let Some(v) = self.account_registered.as_ref() { - struct_ser.serialize_field("accountRegistered", v)?; - } - if let Some(v) = self.tx_executed.as_ref() { - struct_ser.serialize_field("txExecuted", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for IcaSuccess { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "account_registered", - "accountRegistered", - "tx_executed", - "txExecuted", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - AccountRegistered, - TxExecuted, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "accountRegistered" | "account_registered" => { - Ok(GeneratedField::AccountRegistered) - } - "txExecuted" | "tx_executed" => Ok(GeneratedField::TxExecuted), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IcaSuccess; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwica.v1.ICASuccess") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut account_registered__ = None; - let mut tx_executed__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::AccountRegistered => { - if account_registered__.is_some() { - return Err(serde::de::Error::duplicate_field("accountRegistered")); - } - account_registered__ = map.next_value()?; - } - GeneratedField::TxExecuted => { - if tx_executed__.is_some() { - return Err(serde::de::Error::duplicate_field("txExecuted")); - } - tx_executed__ = map.next_value()?; - } - } - } - Ok(IcaSuccess { - account_registered: account_registered__, - tx_executed: tx_executed__, - }) - } - } - deserializer.deserialize_struct("archway.cwica.v1.ICASuccess", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ModuleErrors { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::ErrUnknown => "ERR_UNKNOWN", - Self::ErrPacketTimeout => "ERR_PACKET_TIMEOUT", - Self::ErrExecFailure => "ERR_EXEC_FAILURE", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for ModuleErrors { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["ERR_UNKNOWN", "ERR_PACKET_TIMEOUT", "ERR_EXEC_FAILURE"]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ModuleErrors; - - 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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ModuleErrors::from_i32) - .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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ModuleErrors::from_i32) - .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 { - "ERR_UNKNOWN" => Ok(ModuleErrors::ErrUnknown), - "ERR_PACKET_TIMEOUT" => Ok(ModuleErrors::ErrPacketTimeout), - "ERR_EXEC_FAILURE" => Ok(ModuleErrors::ErrExecFailure), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for MsgRegisterInterchainAccount { - #[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.connection_id.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.cwica.v1.MsgRegisterInterchainAccount", len)?; - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - if !self.connection_id.is_empty() { - struct_ser.serialize_field("connectionId", &self.connection_id)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgRegisterInterchainAccount { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "contract_address", - "contractAddress", - "connection_id", - "connectionId", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ContractAddress, - ConnectionId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } - "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgRegisterInterchainAccount; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwica.v1.MsgRegisterInterchainAccount") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut contract_address__ = None; - let mut connection_id__ = 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::ConnectionId => { - if connection_id__.is_some() { - return Err(serde::de::Error::duplicate_field("connectionId")); - } - connection_id__ = Some(map.next_value()?); - } - } - } - Ok(MsgRegisterInterchainAccount { - contract_address: contract_address__.unwrap_or_default(), - connection_id: connection_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.cwica.v1.MsgRegisterInterchainAccount", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgRegisterInterchainAccountResponse { - #[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("archway.cwica.v1.MsgRegisterInterchainAccountResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgRegisterInterchainAccountResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgRegisterInterchainAccountResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwica.v1.MsgRegisterInterchainAccountResponse") - } - - 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(MsgRegisterInterchainAccountResponse {}) - } - } - deserializer.deserialize_struct( - "archway.cwica.v1.MsgRegisterInterchainAccountResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgSendTx { - #[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.connection_id.is_empty() { - len += 1; - } - if !self.msgs.is_empty() { - len += 1; - } - if !self.memo.is_empty() { - len += 1; - } - if self.timeout != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("archway.cwica.v1.MsgSendTx", len)?; - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - if !self.connection_id.is_empty() { - struct_ser.serialize_field("connectionId", &self.connection_id)?; - } - if !self.msgs.is_empty() { - struct_ser.serialize_field("msgs", &self.msgs)?; - } - if !self.memo.is_empty() { - struct_ser.serialize_field("memo", &self.memo)?; - } - if self.timeout != 0 { - struct_ser.serialize_field("timeout", ToString::to_string(&self.timeout).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSendTx { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "contract_address", - "contractAddress", - "connection_id", - "connectionId", - "msgs", - "memo", - "timeout", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ContractAddress, - ConnectionId, - Msgs, - Memo, - Timeout, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } - "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), - "msgs" => Ok(GeneratedField::Msgs), - "memo" => Ok(GeneratedField::Memo), - "timeout" => Ok(GeneratedField::Timeout), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSendTx; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwica.v1.MsgSendTx") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut contract_address__ = None; - let mut connection_id__ = None; - let mut msgs__ = None; - let mut memo__ = None; - let mut timeout__ = 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::ConnectionId => { - if connection_id__.is_some() { - return Err(serde::de::Error::duplicate_field("connectionId")); - } - connection_id__ = Some(map.next_value()?); - } - GeneratedField::Msgs => { - if msgs__.is_some() { - return Err(serde::de::Error::duplicate_field("msgs")); - } - msgs__ = Some(map.next_value()?); - } - GeneratedField::Memo => { - if memo__.is_some() { - return Err(serde::de::Error::duplicate_field("memo")); - } - memo__ = Some(map.next_value()?); - } - GeneratedField::Timeout => { - if timeout__.is_some() { - return Err(serde::de::Error::duplicate_field("timeout")); - } - timeout__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(MsgSendTx { - contract_address: contract_address__.unwrap_or_default(), - connection_id: connection_id__.unwrap_or_default(), - msgs: msgs__.unwrap_or_default(), - memo: memo__.unwrap_or_default(), - timeout: timeout__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("archway.cwica.v1.MsgSendTx", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgSendTxResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.sequence_id != 0 { - len += 1; - } - if !self.channel.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.cwica.v1.MsgSendTxResponse", len)?; - if self.sequence_id != 0 { - struct_ser.serialize_field( - "sequenceId", - ToString::to_string(&self.sequence_id).as_str(), - )?; - } - if !self.channel.is_empty() { - struct_ser.serialize_field("channel", &self.channel)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSendTxResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["sequence_id", "sequenceId", "channel"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SequenceId, - Channel, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "sequenceId" | "sequence_id" => Ok(GeneratedField::SequenceId), - "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 = MsgSendTxResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwica.v1.MsgSendTxResponse") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sequence_id__ = None; - let mut channel__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::SequenceId => { - if sequence_id__.is_some() { - return Err(serde::de::Error::duplicate_field("sequenceId")); - } - sequence_id__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Channel => { - if channel__.is_some() { - return Err(serde::de::Error::duplicate_field("channel")); - } - channel__ = Some(map.next_value()?); - } - } - } - Ok(MsgSendTxResponse { - sequence_id: sequence_id__.unwrap_or_default(), - channel: channel__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.cwica.v1.MsgSendTxResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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("archway.cwica.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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 archway.cwica.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( - "archway.cwica.v1.MsgUpdateParams", - FIELDS, - GeneratedVisitor, - ) - } -} -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("archway.cwica.v1.MsgUpdateParamsResponse", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 archway.cwica.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( - "archway.cwica.v1.MsgUpdateParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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.msg_send_tx_max_messages != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("archway.cwica.v1.Params", len)?; - if self.msg_send_tx_max_messages != 0 { - struct_ser.serialize_field( - "msgSendTxMaxMessages", - ToString::to_string(&self.msg_send_tx_max_messages).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Params { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["msg_send_tx_max_messages", "msgSendTxMaxMessages"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - MsgSendTxMaxMessages, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "msgSendTxMaxMessages" | "msg_send_tx_max_messages" => { - Ok(GeneratedField::MsgSendTxMaxMessages) - } - _ => 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 archway.cwica.v1.Params") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut msg_send_tx_max_messages__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::MsgSendTxMaxMessages => { - if msg_send_tx_max_messages__.is_some() { - return Err(serde::de::Error::duplicate_field( - "msgSendTxMaxMessages", - )); - } - msg_send_tx_max_messages__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(Params { - msg_send_tx_max_messages: msg_send_tx_max_messages__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("archway.cwica.v1.Params", FIELDS, GeneratedVisitor) - } -} -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("archway.cwica.v1.QueryParamsRequest", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 archway.cwica.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( - "archway.cwica.v1.QueryParamsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -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("archway.cwica.v1.QueryParamsResponse", len)?; - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["params"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 archway.cwica.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( - "archway.cwica.v1.QueryParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for SudoPayload { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.ica.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("archway.cwica.v1.SudoPayload", len)?; - if let Some(v) = self.ica.as_ref() { - struct_ser.serialize_field("ica", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SudoPayload { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["ica"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Ica, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "ica" => Ok(GeneratedField::Ica), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SudoPayload; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwica.v1.SudoPayload") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut ica__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Ica => { - if ica__.is_some() { - return Err(serde::de::Error::duplicate_field("ica")); - } - ica__ = map.next_value()?; - } - } - } - Ok(SudoPayload { ica: ica__ }) - } - } - deserializer.deserialize_struct("archway.cwica.v1.SudoPayload", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for TxExecuted { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.packet.is_some() { - len += 1; - } - if !self.data.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("archway.cwica.v1.TxExecuted", len)?; - if let Some(v) = self.packet.as_ref() { - struct_ser.serialize_field("packet", v)?; - } - if !self.data.is_empty() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TxExecuted { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["packet", "data"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Packet, - Data, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "packet" => Ok(GeneratedField::Packet), - "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 = TxExecuted; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.cwica.v1.TxExecuted") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut packet__ = None; - let mut data__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Packet => { - if packet__.is_some() { - return Err(serde::de::Error::duplicate_field("packet")); - } - packet__ = map.next_value()?; - } - GeneratedField::Data => { - if data__.is_some() { - return Err(serde::de::Error::duplicate_field("data")); - } - data__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - } - } - Ok(TxExecuted { - packet: packet__, - data: data__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("archway.cwica.v1.TxExecuted", FIELDS, GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/archway.genmsg.v1.rs b/packages/proto/src/gen/archway.genmsg.v1.rs index 8f6683e..6865135 100644 --- a/packages/proto/src/gen/archway.genmsg.v1.rs +++ b/packages/proto/src/gen/archway.genmsg.v1.rs @@ -1,5 +1,6 @@ // @generated /// GenesisState represents the messages to be processed during genesis by the genmsg module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -47,5 +48,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x0a, 0x1f, 0x27, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x00, 0x03, 0x12, 0x03, 0x0a, 0x2a, 0x2b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("archway.genmsg.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/archway.genmsg.v1.serde.rs b/packages/proto/src/gen/archway.genmsg.v1.serde.rs deleted file mode 100644 index 30ad533..0000000 --- a/packages/proto/src/gen/archway.genmsg.v1.serde.rs +++ /dev/null @@ -1,93 +0,0 @@ -// @generated -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.messages.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("archway.genmsg.v1.GenesisState", len)?; - if !self.messages.is_empty() { - struct_ser.serialize_field("messages", &self.messages)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GenesisState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["messages"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Messages, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - _ => 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 archway.genmsg.v1.GenesisState") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut messages__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Messages => { - if messages__.is_some() { - return Err(serde::de::Error::duplicate_field("messages")); - } - messages__ = Some(map.next_value()?); - } - } - } - Ok(GenesisState { - messages: messages__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("archway.genmsg.v1.GenesisState", FIELDS, GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/archway.rewards.v1.rs b/packages/proto/src/gen/archway.rewards.v1.rs index d5867aa..4a44f41 100644 --- a/packages/proto/src/gen/archway.rewards.v1.rs +++ b/packages/proto/src/gen/archway.rewards.v1.rs @@ -1,5 +1,6 @@ // @generated /// Params defines the module parameters. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -34,6 +35,7 @@ impl ::prost::Name for Params { } /// ContractMetadata defines the contract rewards distribution options for a /// particular contract. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ContractMetadata { @@ -64,6 +66,7 @@ impl ::prost::Name for ContractMetadata { } } /// BlockRewards defines block related rewards distribution data. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BlockRewards { @@ -86,6 +89,7 @@ impl ::prost::Name for BlockRewards { } } /// TxRewards defines transaction related rewards distribution data. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxRewards { @@ -113,6 +117,7 @@ impl ::prost::Name for TxRewards { /// might be triggered by a Tx (via CLI for example) or by a contract via WASM /// bindings. For a contract to trigger rewards transfer, contract address must /// be set as the rewards_address in a corresponding ContractMetadata. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RewardsRecord { @@ -140,6 +145,7 @@ impl ::prost::Name for RewardsRecord { } } /// FlatFee defines the flat fee for a particular contract. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FlatFee { @@ -159,6 +165,7 @@ impl ::prost::Name for FlatFee { } /// ContractMetadataSetEvent is emitted when the contract metadata is created or /// updated. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ContractMetadataSetEvent { @@ -178,6 +185,7 @@ impl ::prost::Name for ContractMetadataSetEvent { } /// ContractRewardCalculationEvent is emitted when the contract reward is /// calculated. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ContractRewardCalculationEvent { @@ -209,6 +217,7 @@ impl ::prost::Name for ContractRewardCalculationEvent { /// RewardsWithdrawEvent is emitted when credited rewards for a specific /// rewards_address are distributed. Event could be triggered by a transaction /// (via CLI for example) or by a contract via WASM bindings. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RewardsWithdrawEvent { @@ -227,6 +236,7 @@ impl ::prost::Name for RewardsWithdrawEvent { } } /// MinConsensusFeeSetEvent is emitted when the minimum consensus fee is updated. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MinConsensusFeeSetEvent { @@ -242,6 +252,7 @@ impl ::prost::Name for MinConsensusFeeSetEvent { } } /// ContractFlatFeeSetEvent is emitted when the contract flat fee is updated +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ContractFlatFeeSetEvent { @@ -262,6 +273,7 @@ impl ::prost::Name for ContractFlatFeeSetEvent { } } /// GenesisState defines the initial state of the tracking module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -300,6 +312,7 @@ impl ::prost::Name for GenesisState { } } /// QueryParamsRequest is the request for Query.Params. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} @@ -311,6 +324,7 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse is the response for Query.Params. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -325,6 +339,7 @@ impl ::prost::Name for QueryParamsResponse { } } /// QueryContractMetadataRequest is the request for Query.ContractMetadata. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryContractMetadataRequest { @@ -340,6 +355,7 @@ impl ::prost::Name for QueryContractMetadataRequest { } } /// QueryContractMetadataResponse is the response for Query.ContractMetadata. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryContractMetadataResponse { @@ -355,6 +371,7 @@ impl ::prost::Name for QueryContractMetadataResponse { } /// QueryBlockRewardsTrackingRequest is the request for /// Query.BlockRewardsTracking. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBlockRewardsTrackingRequest {} @@ -367,6 +384,7 @@ impl ::prost::Name for QueryBlockRewardsTrackingRequest { } /// QueryBlockRewardsTrackingResponse is the response for /// Query.BlockRewardsTracking. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBlockRewardsTrackingResponse { @@ -381,6 +399,7 @@ impl ::prost::Name for QueryBlockRewardsTrackingResponse { } } /// QueryRewardsPoolRequest is the request for Query.RewardsPool. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryRewardsPoolRequest {} @@ -392,6 +411,7 @@ impl ::prost::Name for QueryRewardsPoolRequest { } } /// QueryRewardsPoolResponse is the response for Query.RewardsPool. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryRewardsPoolResponse { @@ -413,6 +433,7 @@ impl ::prost::Name for QueryRewardsPoolResponse { } } /// QueryEstimateTxFeesRequest is the request for Query.EstimateTxFees. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEstimateTxFeesRequest { @@ -431,6 +452,7 @@ impl ::prost::Name for QueryEstimateTxFeesRequest { } } /// QueryEstimateTxFeesResponse is the response for Query.EstimateTxFees. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEstimateTxFeesResponse { @@ -449,6 +471,7 @@ impl ::prost::Name for QueryEstimateTxFeesResponse { } } /// BlockTracking is the tracking information for a block. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BlockTracking { @@ -467,6 +490,7 @@ impl ::prost::Name for BlockTracking { } } /// QueryRewardsRecordsRequest is the request for Query.RewardsRecords. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryRewardsRecordsRequest { @@ -487,6 +511,7 @@ impl ::prost::Name for QueryRewardsRecordsRequest { } } /// QueryRewardsRecordsResponse is the response for Query.RewardsRecords. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryRewardsRecordsResponse { @@ -506,6 +531,7 @@ impl ::prost::Name for QueryRewardsRecordsResponse { } } /// QueryOutstandingRewardsRequest is the request for Query.OutstandingRewards. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryOutstandingRewardsRequest { @@ -522,6 +548,7 @@ impl ::prost::Name for QueryOutstandingRewardsRequest { } } /// QueryOutstandingRewardsResponse is the response for Query.OutstandingRewards. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryOutstandingRewardsResponse { @@ -541,6 +568,7 @@ impl ::prost::Name for QueryOutstandingRewardsResponse { } } /// QueryFlatFeeRequest is the request for Query.FlatFeet +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryFlatFeeRequest { @@ -556,6 +584,7 @@ impl ::prost::Name for QueryFlatFeeRequest { } } /// QueryFlatFeeResponse is the response for Query.FlatFee +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryFlatFeeResponse { @@ -572,6 +601,7 @@ impl ::prost::Name for QueryFlatFeeResponse { } } /// MsgSetContractMetadata is the request for Msg.SetContractMetadata. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetContractMetadata { @@ -591,6 +621,7 @@ impl ::prost::Name for MsgSetContractMetadata { } } /// MsgSetContractMetadataResponse is the response for Msg.SetContractMetadata. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetContractMetadataResponse {} @@ -602,6 +633,7 @@ impl ::prost::Name for MsgSetContractMetadataResponse { } } /// MsgWithdrawRewards is the request for Msg.WithdrawRewards. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawRewards { @@ -614,6 +646,7 @@ pub struct MsgWithdrawRewards { } /// Nested message and enum types in `MsgWithdrawRewards`. pub mod msg_withdraw_rewards { + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RecordsLimit { @@ -627,6 +660,7 @@ pub mod msg_withdraw_rewards { ::prost::alloc::format!("archway.rewards.v1.MsgWithdrawRewards.{}", Self::NAME) } } + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RecordIDs { @@ -641,6 +675,7 @@ pub mod msg_withdraw_rewards { } } /// mode defines the operation type. + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Mode { @@ -661,6 +696,7 @@ impl ::prost::Name for MsgWithdrawRewards { } } /// MsgWithdrawRewardsResponse is the response for Msg.WithdrawRewards. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawRewardsResponse { @@ -679,6 +715,7 @@ impl ::prost::Name for MsgWithdrawRewardsResponse { } } /// MsgSetFlatFee is the request for Msg.SetFlatFee. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetFlatFee { @@ -700,6 +737,7 @@ impl ::prost::Name for MsgSetFlatFee { } } /// MsgSetFlatFeeResponse is the response for Msg.SetFlatFee. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetFlatFeeResponse {} @@ -713,6 +751,7 @@ impl ::prost::Name for MsgSetFlatFeeResponse { /// MsgUpdateParams is the Msg/UpdateParams request type. /// /// Since: archway v5 && cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -736,6 +775,7 @@ impl ::prost::Name for MsgUpdateParams { /// MsgUpdateParams message. /// /// Since: archway v5 && cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} @@ -2459,6 +2499,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x0a, 0x0a, 0x0a, 0x03, 0x04, 0x07, 0x01, 0x12, 0x03, 0x6e, 0x08, 0x1f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("archway.rewards.v1.serde.rs"); include!("archway.rewards.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/archway.rewards.v1.serde.rs b/packages/proto/src/gen/archway.rewards.v1.serde.rs deleted file mode 100644 index 2b1e093..0000000 --- a/packages/proto/src/gen/archway.rewards.v1.serde.rs +++ /dev/null @@ -1,4618 +0,0 @@ -// @generated -impl serde::Serialize for BlockRewards { - #[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.inflation_rewards.is_some() { - len += 1; - } - if self.max_gas != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("archway.rewards.v1.BlockRewards", len)?; - if self.height != 0 { - struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; - } - if let Some(v) = self.inflation_rewards.as_ref() { - struct_ser.serialize_field("inflationRewards", v)?; - } - if self.max_gas != 0 { - struct_ser.serialize_field("maxGas", ToString::to_string(&self.max_gas).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for BlockRewards { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "height", - "inflation_rewards", - "inflationRewards", - "max_gas", - "maxGas", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Height, - InflationRewards, - MaxGas, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "inflationRewards" | "inflation_rewards" => { - Ok(GeneratedField::InflationRewards) - } - "maxGas" | "max_gas" => Ok(GeneratedField::MaxGas), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = BlockRewards; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.BlockRewards") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut height__ = None; - let mut inflation_rewards__ = None; - let mut max_gas__ = 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::InflationRewards => { - if inflation_rewards__.is_some() { - return Err(serde::de::Error::duplicate_field("inflationRewards")); - } - inflation_rewards__ = map.next_value()?; - } - GeneratedField::MaxGas => { - if max_gas__.is_some() { - return Err(serde::de::Error::duplicate_field("maxGas")); - } - max_gas__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(BlockRewards { - height: height__.unwrap_or_default(), - inflation_rewards: inflation_rewards__, - max_gas: max_gas__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("archway.rewards.v1.BlockRewards", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for BlockTracking { - #[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_rewards.is_some() { - len += 1; - } - if !self.tx_rewards.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.rewards.v1.BlockTracking", len)?; - if let Some(v) = self.inflation_rewards.as_ref() { - struct_ser.serialize_field("inflationRewards", v)?; - } - if !self.tx_rewards.is_empty() { - struct_ser.serialize_field("txRewards", &self.tx_rewards)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for BlockTracking { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "inflation_rewards", - "inflationRewards", - "tx_rewards", - "txRewards", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - InflationRewards, - TxRewards, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "inflationRewards" | "inflation_rewards" => { - Ok(GeneratedField::InflationRewards) - } - "txRewards" | "tx_rewards" => Ok(GeneratedField::TxRewards), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = BlockTracking; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.BlockTracking") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut inflation_rewards__ = None; - let mut tx_rewards__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::InflationRewards => { - if inflation_rewards__.is_some() { - return Err(serde::de::Error::duplicate_field("inflationRewards")); - } - inflation_rewards__ = map.next_value()?; - } - GeneratedField::TxRewards => { - if tx_rewards__.is_some() { - return Err(serde::de::Error::duplicate_field("txRewards")); - } - tx_rewards__ = Some(map.next_value()?); - } - } - } - Ok(BlockTracking { - inflation_rewards: inflation_rewards__, - tx_rewards: tx_rewards__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.BlockTracking", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ContractFlatFeeSetEvent { - #[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.flat_fee.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.rewards.v1.ContractFlatFeeSetEvent", len)?; - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - if let Some(v) = self.flat_fee.as_ref() { - struct_ser.serialize_field("flatFee", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ContractFlatFeeSetEvent { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["contract_address", "contractAddress", "flat_fee", "flatFee"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ContractAddress, - FlatFee, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } - "flatFee" | "flat_fee" => Ok(GeneratedField::FlatFee), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ContractFlatFeeSetEvent; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.ContractFlatFeeSetEvent") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut contract_address__ = None; - let mut flat_fee__ = 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::FlatFee => { - if flat_fee__.is_some() { - return Err(serde::de::Error::duplicate_field("flatFee")); - } - flat_fee__ = map.next_value()?; - } - } - } - Ok(ContractFlatFeeSetEvent { - contract_address: contract_address__.unwrap_or_default(), - flat_fee: flat_fee__, - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.ContractFlatFeeSetEvent", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ContractMetadata { - #[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.owner_address.is_empty() { - len += 1; - } - if !self.rewards_address.is_empty() { - len += 1; - } - if self.withdraw_to_wallet { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.rewards.v1.ContractMetadata", len)?; - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - if !self.owner_address.is_empty() { - struct_ser.serialize_field("ownerAddress", &self.owner_address)?; - } - if !self.rewards_address.is_empty() { - struct_ser.serialize_field("rewardsAddress", &self.rewards_address)?; - } - if self.withdraw_to_wallet { - struct_ser.serialize_field("withdrawToWallet", &self.withdraw_to_wallet)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ContractMetadata { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "contract_address", - "contractAddress", - "owner_address", - "ownerAddress", - "rewards_address", - "rewardsAddress", - "withdraw_to_wallet", - "withdrawToWallet", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ContractAddress, - OwnerAddress, - RewardsAddress, - WithdrawToWallet, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } - "ownerAddress" | "owner_address" => Ok(GeneratedField::OwnerAddress), - "rewardsAddress" | "rewards_address" => { - Ok(GeneratedField::RewardsAddress) - } - "withdrawToWallet" | "withdraw_to_wallet" => { - Ok(GeneratedField::WithdrawToWallet) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ContractMetadata; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.ContractMetadata") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut contract_address__ = None; - let mut owner_address__ = None; - let mut rewards_address__ = None; - let mut withdraw_to_wallet__ = 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::OwnerAddress => { - if owner_address__.is_some() { - return Err(serde::de::Error::duplicate_field("ownerAddress")); - } - owner_address__ = Some(map.next_value()?); - } - GeneratedField::RewardsAddress => { - if rewards_address__.is_some() { - return Err(serde::de::Error::duplicate_field("rewardsAddress")); - } - rewards_address__ = Some(map.next_value()?); - } - GeneratedField::WithdrawToWallet => { - if withdraw_to_wallet__.is_some() { - return Err(serde::de::Error::duplicate_field("withdrawToWallet")); - } - withdraw_to_wallet__ = Some(map.next_value()?); - } - } - } - Ok(ContractMetadata { - contract_address: contract_address__.unwrap_or_default(), - owner_address: owner_address__.unwrap_or_default(), - rewards_address: rewards_address__.unwrap_or_default(), - withdraw_to_wallet: withdraw_to_wallet__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.ContractMetadata", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ContractMetadataSetEvent { - #[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.metadata.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.rewards.v1.ContractMetadataSetEvent", len)?; - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - if let Some(v) = self.metadata.as_ref() { - struct_ser.serialize_field("metadata", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ContractMetadataSetEvent { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["contract_address", "contractAddress", "metadata"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ContractAddress, - Metadata, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } - "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 = ContractMetadataSetEvent; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.ContractMetadataSetEvent") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut contract_address__ = None; - let mut metadata__ = 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::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); - } - metadata__ = map.next_value()?; - } - } - } - Ok(ContractMetadataSetEvent { - contract_address: contract_address__.unwrap_or_default(), - metadata: metadata__, - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.ContractMetadataSetEvent", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ContractRewardCalculationEvent { - #[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.gas_consumed != 0 { - len += 1; - } - if self.inflation_rewards.is_some() { - len += 1; - } - if !self.fee_rebate_rewards.is_empty() { - len += 1; - } - if self.metadata.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("archway.rewards.v1.ContractRewardCalculationEvent", len)?; - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - if self.gas_consumed != 0 { - struct_ser.serialize_field( - "gasConsumed", - ToString::to_string(&self.gas_consumed).as_str(), - )?; - } - if let Some(v) = self.inflation_rewards.as_ref() { - struct_ser.serialize_field("inflationRewards", v)?; - } - if !self.fee_rebate_rewards.is_empty() { - struct_ser.serialize_field("feeRebateRewards", &self.fee_rebate_rewards)?; - } - if let Some(v) = self.metadata.as_ref() { - struct_ser.serialize_field("metadata", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ContractRewardCalculationEvent { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "contract_address", - "contractAddress", - "gas_consumed", - "gasConsumed", - "inflation_rewards", - "inflationRewards", - "fee_rebate_rewards", - "feeRebateRewards", - "metadata", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ContractAddress, - GasConsumed, - InflationRewards, - FeeRebateRewards, - Metadata, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } - "gasConsumed" | "gas_consumed" => Ok(GeneratedField::GasConsumed), - "inflationRewards" | "inflation_rewards" => { - Ok(GeneratedField::InflationRewards) - } - "feeRebateRewards" | "fee_rebate_rewards" => { - Ok(GeneratedField::FeeRebateRewards) - } - "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 = ContractRewardCalculationEvent; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.ContractRewardCalculationEvent") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut contract_address__ = None; - let mut gas_consumed__ = None; - let mut inflation_rewards__ = None; - let mut fee_rebate_rewards__ = None; - let mut metadata__ = 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::GasConsumed => { - if gas_consumed__.is_some() { - return Err(serde::de::Error::duplicate_field("gasConsumed")); - } - gas_consumed__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::InflationRewards => { - if inflation_rewards__.is_some() { - return Err(serde::de::Error::duplicate_field("inflationRewards")); - } - inflation_rewards__ = map.next_value()?; - } - GeneratedField::FeeRebateRewards => { - if fee_rebate_rewards__.is_some() { - return Err(serde::de::Error::duplicate_field("feeRebateRewards")); - } - fee_rebate_rewards__ = Some(map.next_value()?); - } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); - } - metadata__ = map.next_value()?; - } - } - } - Ok(ContractRewardCalculationEvent { - contract_address: contract_address__.unwrap_or_default(), - gas_consumed: gas_consumed__.unwrap_or_default(), - inflation_rewards: inflation_rewards__, - fee_rebate_rewards: fee_rebate_rewards__.unwrap_or_default(), - metadata: metadata__, - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.ContractRewardCalculationEvent", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for FlatFee { - #[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.flat_fee.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("archway.rewards.v1.FlatFee", len)?; - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - if let Some(v) = self.flat_fee.as_ref() { - struct_ser.serialize_field("flatFee", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for FlatFee { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["contract_address", "contractAddress", "flat_fee", "flatFee"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ContractAddress, - FlatFee, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } - "flatFee" | "flat_fee" => Ok(GeneratedField::FlatFee), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = FlatFee; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.FlatFee") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut contract_address__ = None; - let mut flat_fee__ = 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::FlatFee => { - if flat_fee__.is_some() { - return Err(serde::de::Error::duplicate_field("flatFee")); - } - flat_fee__ = map.next_value()?; - } - } - } - Ok(FlatFee { - contract_address: contract_address__.unwrap_or_default(), - flat_fee: flat_fee__, - }) - } - } - deserializer.deserialize_struct("archway.rewards.v1.FlatFee", FIELDS, GeneratedVisitor) - } -} -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.contracts_metadata.is_empty() { - len += 1; - } - if !self.block_rewards.is_empty() { - len += 1; - } - if !self.tx_rewards.is_empty() { - len += 1; - } - if self.min_consensus_fee.is_some() { - len += 1; - } - if self.rewards_record_last_id != 0 { - len += 1; - } - if !self.rewards_records.is_empty() { - len += 1; - } - if !self.flat_fees.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("archway.rewards.v1.GenesisState", len)?; - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - if !self.contracts_metadata.is_empty() { - struct_ser.serialize_field("contractsMetadata", &self.contracts_metadata)?; - } - if !self.block_rewards.is_empty() { - struct_ser.serialize_field("blockRewards", &self.block_rewards)?; - } - if !self.tx_rewards.is_empty() { - struct_ser.serialize_field("txRewards", &self.tx_rewards)?; - } - if let Some(v) = self.min_consensus_fee.as_ref() { - struct_ser.serialize_field("minConsensusFee", v)?; - } - if self.rewards_record_last_id != 0 { - struct_ser.serialize_field( - "rewardsRecordLastId", - ToString::to_string(&self.rewards_record_last_id).as_str(), - )?; - } - if !self.rewards_records.is_empty() { - struct_ser.serialize_field("rewardsRecords", &self.rewards_records)?; - } - if !self.flat_fees.is_empty() { - struct_ser.serialize_field("flatFees", &self.flat_fees)?; - } - struct_ser.end() - } -} -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", - "contracts_metadata", - "contractsMetadata", - "block_rewards", - "blockRewards", - "tx_rewards", - "txRewards", - "min_consensus_fee", - "minConsensusFee", - "rewards_record_last_id", - "rewardsRecordLastId", - "rewards_records", - "rewardsRecords", - "flat_fees", - "flatFees", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - ContractsMetadata, - BlockRewards, - TxRewards, - MinConsensusFee, - RewardsRecordLastId, - RewardsRecords, - FlatFees, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "contractsMetadata" | "contracts_metadata" => { - Ok(GeneratedField::ContractsMetadata) - } - "blockRewards" | "block_rewards" => Ok(GeneratedField::BlockRewards), - "txRewards" | "tx_rewards" => Ok(GeneratedField::TxRewards), - "minConsensusFee" | "min_consensus_fee" => { - Ok(GeneratedField::MinConsensusFee) - } - "rewardsRecordLastId" | "rewards_record_last_id" => { - Ok(GeneratedField::RewardsRecordLastId) - } - "rewardsRecords" | "rewards_records" => { - Ok(GeneratedField::RewardsRecords) - } - "flatFees" | "flat_fees" => Ok(GeneratedField::FlatFees), - _ => 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 archway.rewards.v1.GenesisState") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut params__ = None; - let mut contracts_metadata__ = None; - let mut block_rewards__ = None; - let mut tx_rewards__ = None; - let mut min_consensus_fee__ = None; - let mut rewards_record_last_id__ = None; - let mut rewards_records__ = None; - let mut flat_fees__ = 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::ContractsMetadata => { - if contracts_metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("contractsMetadata")); - } - contracts_metadata__ = Some(map.next_value()?); - } - GeneratedField::BlockRewards => { - if block_rewards__.is_some() { - return Err(serde::de::Error::duplicate_field("blockRewards")); - } - block_rewards__ = Some(map.next_value()?); - } - GeneratedField::TxRewards => { - if tx_rewards__.is_some() { - return Err(serde::de::Error::duplicate_field("txRewards")); - } - tx_rewards__ = Some(map.next_value()?); - } - GeneratedField::MinConsensusFee => { - if min_consensus_fee__.is_some() { - return Err(serde::de::Error::duplicate_field("minConsensusFee")); - } - min_consensus_fee__ = map.next_value()?; - } - GeneratedField::RewardsRecordLastId => { - if rewards_record_last_id__.is_some() { - return Err(serde::de::Error::duplicate_field( - "rewardsRecordLastId", - )); - } - rewards_record_last_id__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::RewardsRecords => { - if rewards_records__.is_some() { - return Err(serde::de::Error::duplicate_field("rewardsRecords")); - } - rewards_records__ = Some(map.next_value()?); - } - GeneratedField::FlatFees => { - if flat_fees__.is_some() { - return Err(serde::de::Error::duplicate_field("flatFees")); - } - flat_fees__ = Some(map.next_value()?); - } - } - } - Ok(GenesisState { - params: params__, - contracts_metadata: contracts_metadata__.unwrap_or_default(), - block_rewards: block_rewards__.unwrap_or_default(), - tx_rewards: tx_rewards__.unwrap_or_default(), - min_consensus_fee: min_consensus_fee__, - rewards_record_last_id: rewards_record_last_id__.unwrap_or_default(), - rewards_records: rewards_records__.unwrap_or_default(), - flat_fees: flat_fees__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("archway.rewards.v1.GenesisState", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MinConsensusFeeSetEvent { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.fee.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.rewards.v1.MinConsensusFeeSetEvent", len)?; - if let Some(v) = self.fee.as_ref() { - struct_ser.serialize_field("fee", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MinConsensusFeeSetEvent { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["fee"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Fee, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "fee" => Ok(GeneratedField::Fee), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MinConsensusFeeSetEvent; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.MinConsensusFeeSetEvent") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut fee__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Fee => { - if fee__.is_some() { - return Err(serde::de::Error::duplicate_field("fee")); - } - fee__ = map.next_value()?; - } - } - } - Ok(MinConsensusFeeSetEvent { fee: fee__ }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.MinConsensusFeeSetEvent", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgSetContractMetadata { - #[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_address.is_empty() { - len += 1; - } - if self.metadata.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.rewards.v1.MsgSetContractMetadata", len)?; - if !self.sender_address.is_empty() { - struct_ser.serialize_field("senderAddress", &self.sender_address)?; - } - if let Some(v) = self.metadata.as_ref() { - struct_ser.serialize_field("metadata", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSetContractMetadata { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["sender_address", "senderAddress", "metadata"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SenderAddress, - Metadata, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "senderAddress" | "sender_address" => Ok(GeneratedField::SenderAddress), - "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 = MsgSetContractMetadata; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.MsgSetContractMetadata") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sender_address__ = None; - let mut metadata__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::SenderAddress => { - if sender_address__.is_some() { - return Err(serde::de::Error::duplicate_field("senderAddress")); - } - sender_address__ = Some(map.next_value()?); - } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); - } - metadata__ = map.next_value()?; - } - } - } - Ok(MsgSetContractMetadata { - sender_address: sender_address__.unwrap_or_default(), - metadata: metadata__, - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.MsgSetContractMetadata", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgSetContractMetadataResponse { - #[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("archway.rewards.v1.MsgSetContractMetadataResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSetContractMetadataResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgSetContractMetadataResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.MsgSetContractMetadataResponse") - } - - 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(MsgSetContractMetadataResponse {}) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.MsgSetContractMetadataResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgSetFlatFee { - #[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_address.is_empty() { - len += 1; - } - if !self.contract_address.is_empty() { - len += 1; - } - if self.flat_fee_amount.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.rewards.v1.MsgSetFlatFee", len)?; - if !self.sender_address.is_empty() { - struct_ser.serialize_field("senderAddress", &self.sender_address)?; - } - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - if let Some(v) = self.flat_fee_amount.as_ref() { - struct_ser.serialize_field("flatFeeAmount", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSetFlatFee { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "sender_address", - "senderAddress", - "contract_address", - "contractAddress", - "flat_fee_amount", - "flatFeeAmount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SenderAddress, - ContractAddress, - FlatFeeAmount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "senderAddress" | "sender_address" => Ok(GeneratedField::SenderAddress), - "contractAddress" | "contract_address" => { - Ok(GeneratedField::ContractAddress) - } - "flatFeeAmount" | "flat_fee_amount" => { - Ok(GeneratedField::FlatFeeAmount) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSetFlatFee; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.MsgSetFlatFee") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sender_address__ = None; - let mut contract_address__ = None; - let mut flat_fee_amount__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::SenderAddress => { - if sender_address__.is_some() { - return Err(serde::de::Error::duplicate_field("senderAddress")); - } - sender_address__ = Some(map.next_value()?); - } - GeneratedField::ContractAddress => { - if contract_address__.is_some() { - return Err(serde::de::Error::duplicate_field("contractAddress")); - } - contract_address__ = Some(map.next_value()?); - } - GeneratedField::FlatFeeAmount => { - if flat_fee_amount__.is_some() { - return Err(serde::de::Error::duplicate_field("flatFeeAmount")); - } - flat_fee_amount__ = map.next_value()?; - } - } - } - Ok(MsgSetFlatFee { - sender_address: sender_address__.unwrap_or_default(), - contract_address: contract_address__.unwrap_or_default(), - flat_fee_amount: flat_fee_amount__, - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.MsgSetFlatFee", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgSetFlatFeeResponse { - #[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("archway.rewards.v1.MsgSetFlatFeeResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSetFlatFeeResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgSetFlatFeeResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.MsgSetFlatFeeResponse") - } - - 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(MsgSetFlatFeeResponse {}) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.MsgSetFlatFeeResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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("archway.rewards.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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 archway.rewards.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( - "archway.rewards.v1.MsgUpdateParams", - FIELDS, - GeneratedVisitor, - ) - } -} -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("archway.rewards.v1.MsgUpdateParamsResponse", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 archway.rewards.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( - "archway.rewards.v1.MsgUpdateParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgWithdrawRewards { - #[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_address.is_empty() { - len += 1; - } - if self.mode.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.rewards.v1.MsgWithdrawRewards", len)?; - if !self.rewards_address.is_empty() { - struct_ser.serialize_field("rewardsAddress", &self.rewards_address)?; - } - if let Some(v) = self.mode.as_ref() { - match v { - msg_withdraw_rewards::Mode::RecordsLimit(v) => { - struct_ser.serialize_field("recordsLimit", v)?; - } - msg_withdraw_rewards::Mode::RecordIds(v) => { - struct_ser.serialize_field("recordIds", v)?; - } - } - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgWithdrawRewards { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "rewards_address", - "rewardsAddress", - "records_limit", - "recordsLimit", - "record_ids", - "recordIds", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - RewardsAddress, - RecordsLimit, - RecordIds, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "rewardsAddress" | "rewards_address" => { - Ok(GeneratedField::RewardsAddress) - } - "recordsLimit" | "records_limit" => Ok(GeneratedField::RecordsLimit), - "recordIds" | "record_ids" => Ok(GeneratedField::RecordIds), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgWithdrawRewards; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.MsgWithdrawRewards") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut rewards_address__ = None; - let mut mode__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::RewardsAddress => { - if rewards_address__.is_some() { - return Err(serde::de::Error::duplicate_field("rewardsAddress")); - } - rewards_address__ = Some(map.next_value()?); - } - GeneratedField::RecordsLimit => { - if mode__.is_some() { - return Err(serde::de::Error::duplicate_field("recordsLimit")); - } - mode__ = map - .next_value::<::std::option::Option<_>>()? - .map(msg_withdraw_rewards::Mode::RecordsLimit); - } - GeneratedField::RecordIds => { - if mode__.is_some() { - return Err(serde::de::Error::duplicate_field("recordIds")); - } - mode__ = map - .next_value::<::std::option::Option<_>>()? - .map(msg_withdraw_rewards::Mode::RecordIds); - } - } - } - Ok(MsgWithdrawRewards { - rewards_address: rewards_address__.unwrap_or_default(), - mode: mode__, - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.MsgWithdrawRewards", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for msg_withdraw_rewards::RecordIDs { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.ids.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.rewards.v1.MsgWithdrawRewards.RecordIDs", len)?; - if !self.ids.is_empty() { - struct_ser.serialize_field( - "ids", - &self.ids.iter().map(ToString::to_string).collect::>(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for msg_withdraw_rewards::RecordIDs { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["ids"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Ids, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "ids" => Ok(GeneratedField::Ids), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = msg_withdraw_rewards::RecordIDs; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.MsgWithdrawRewards.RecordIDs") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut ids__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Ids => { - if ids__.is_some() { - return Err(serde::de::Error::duplicate_field("ids")); - } - ids__ = Some( - map.next_value::>>()? - .into_iter() - .map(|x| x.0) - .collect(), - ); - } - } - } - Ok(msg_withdraw_rewards::RecordIDs { - ids: ids__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.MsgWithdrawRewards.RecordIDs", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for msg_withdraw_rewards::RecordsLimit { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.limit != 0 { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("archway.rewards.v1.MsgWithdrawRewards.RecordsLimit", len)?; - if self.limit != 0 { - struct_ser.serialize_field("limit", ToString::to_string(&self.limit).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for msg_withdraw_rewards::RecordsLimit { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["limit"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Limit, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "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 = msg_withdraw_rewards::RecordsLimit; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.MsgWithdrawRewards.RecordsLimit") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut limit__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Limit => { - if limit__.is_some() { - return Err(serde::de::Error::duplicate_field("limit")); - } - limit__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(msg_withdraw_rewards::RecordsLimit { - limit: limit__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.MsgWithdrawRewards.RecordsLimit", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgWithdrawRewardsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.records_num != 0 { - len += 1; - } - if !self.total_rewards.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.rewards.v1.MsgWithdrawRewardsResponse", len)?; - if self.records_num != 0 { - struct_ser.serialize_field( - "recordsNum", - ToString::to_string(&self.records_num).as_str(), - )?; - } - if !self.total_rewards.is_empty() { - struct_ser.serialize_field("totalRewards", &self.total_rewards)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgWithdrawRewardsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["records_num", "recordsNum", "total_rewards", "totalRewards"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - RecordsNum, - TotalRewards, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "recordsNum" | "records_num" => Ok(GeneratedField::RecordsNum), - "totalRewards" | "total_rewards" => Ok(GeneratedField::TotalRewards), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgWithdrawRewardsResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.MsgWithdrawRewardsResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut records_num__ = None; - let mut total_rewards__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::RecordsNum => { - if records_num__.is_some() { - return Err(serde::de::Error::duplicate_field("recordsNum")); - } - records_num__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::TotalRewards => { - if total_rewards__.is_some() { - return Err(serde::de::Error::duplicate_field("totalRewards")); - } - total_rewards__ = Some(map.next_value()?); - } - } - } - Ok(MsgWithdrawRewardsResponse { - records_num: records_num__.unwrap_or_default(), - total_rewards: total_rewards__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.MsgWithdrawRewardsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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.inflation_rewards_ratio.is_empty() { - len += 1; - } - if !self.tx_fee_rebate_ratio.is_empty() { - len += 1; - } - if self.max_withdraw_records != 0 { - len += 1; - } - if self.min_price_of_gas.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("archway.rewards.v1.Params", len)?; - if !self.inflation_rewards_ratio.is_empty() { - struct_ser.serialize_field("inflationRewardsRatio", &self.inflation_rewards_ratio)?; - } - if !self.tx_fee_rebate_ratio.is_empty() { - struct_ser.serialize_field("txFeeRebateRatio", &self.tx_fee_rebate_ratio)?; - } - if self.max_withdraw_records != 0 { - struct_ser.serialize_field( - "maxWithdrawRecords", - ToString::to_string(&self.max_withdraw_records).as_str(), - )?; - } - if let Some(v) = self.min_price_of_gas.as_ref() { - struct_ser.serialize_field("minPriceOfGas", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Params { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "inflation_rewards_ratio", - "inflationRewardsRatio", - "tx_fee_rebate_ratio", - "txFeeRebateRatio", - "max_withdraw_records", - "maxWithdrawRecords", - "min_price_of_gas", - "minPriceOfGas", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - InflationRewardsRatio, - TxFeeRebateRatio, - MaxWithdrawRecords, - MinPriceOfGas, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "inflationRewardsRatio" | "inflation_rewards_ratio" => { - Ok(GeneratedField::InflationRewardsRatio) - } - "txFeeRebateRatio" | "tx_fee_rebate_ratio" => { - Ok(GeneratedField::TxFeeRebateRatio) - } - "maxWithdrawRecords" | "max_withdraw_records" => { - Ok(GeneratedField::MaxWithdrawRecords) - } - "minPriceOfGas" | "min_price_of_gas" => { - Ok(GeneratedField::MinPriceOfGas) - } - _ => 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 archway.rewards.v1.Params") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut inflation_rewards_ratio__ = None; - let mut tx_fee_rebate_ratio__ = None; - let mut max_withdraw_records__ = None; - let mut min_price_of_gas__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::InflationRewardsRatio => { - if inflation_rewards_ratio__.is_some() { - return Err(serde::de::Error::duplicate_field( - "inflationRewardsRatio", - )); - } - inflation_rewards_ratio__ = Some(map.next_value()?); - } - GeneratedField::TxFeeRebateRatio => { - if tx_fee_rebate_ratio__.is_some() { - return Err(serde::de::Error::duplicate_field("txFeeRebateRatio")); - } - tx_fee_rebate_ratio__ = Some(map.next_value()?); - } - GeneratedField::MaxWithdrawRecords => { - if max_withdraw_records__.is_some() { - return Err(serde::de::Error::duplicate_field( - "maxWithdrawRecords", - )); - } - max_withdraw_records__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::MinPriceOfGas => { - if min_price_of_gas__.is_some() { - return Err(serde::de::Error::duplicate_field("minPriceOfGas")); - } - min_price_of_gas__ = map.next_value()?; - } - } - } - Ok(Params { - inflation_rewards_ratio: inflation_rewards_ratio__.unwrap_or_default(), - tx_fee_rebate_ratio: tx_fee_rebate_ratio__.unwrap_or_default(), - max_withdraw_records: max_withdraw_records__.unwrap_or_default(), - min_price_of_gas: min_price_of_gas__, - }) - } - } - deserializer.deserialize_struct("archway.rewards.v1.Params", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryBlockRewardsTrackingRequest { - #[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("archway.rewards.v1.QueryBlockRewardsTrackingRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryBlockRewardsTrackingRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = QueryBlockRewardsTrackingRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.QueryBlockRewardsTrackingRequest") - } - - 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(QueryBlockRewardsTrackingRequest {}) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.QueryBlockRewardsTrackingRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryBlockRewardsTrackingResponse { - #[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.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("archway.rewards.v1.QueryBlockRewardsTrackingResponse", len)?; - if let Some(v) = self.block.as_ref() { - struct_ser.serialize_field("block", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryBlockRewardsTrackingResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["block"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Block, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "block" => Ok(GeneratedField::Block), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryBlockRewardsTrackingResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.QueryBlockRewardsTrackingResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut block__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Block => { - if block__.is_some() { - return Err(serde::de::Error::duplicate_field("block")); - } - block__ = map.next_value()?; - } - } - } - Ok(QueryBlockRewardsTrackingResponse { block: block__ }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.QueryBlockRewardsTrackingResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryContractMetadataRequest { - #[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; - } - let mut struct_ser = - serializer.serialize_struct("archway.rewards.v1.QueryContractMetadataRequest", len)?; - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryContractMetadataRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["contract_address", "contractAddress"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ContractAddress, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryContractMetadataRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.QueryContractMetadataRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut contract_address__ = 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()?); - } - } - } - Ok(QueryContractMetadataRequest { - contract_address: contract_address__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.QueryContractMetadataRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryContractMetadataResponse { - #[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("archway.rewards.v1.QueryContractMetadataResponse", len)?; - if let Some(v) = self.metadata.as_ref() { - struct_ser.serialize_field("metadata", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryContractMetadataResponse { - #[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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = QueryContractMetadataResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.QueryContractMetadataResponse") - } - - 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(QueryContractMetadataResponse { - metadata: metadata__, - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.QueryContractMetadataResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryEstimateTxFeesRequest { - #[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_limit != 0 { - len += 1; - } - if !self.contract_address.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.rewards.v1.QueryEstimateTxFeesRequest", len)?; - if self.gas_limit != 0 { - struct_ser - .serialize_field("gasLimit", ToString::to_string(&self.gas_limit).as_str())?; - } - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryEstimateTxFeesRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "gas_limit", - "gasLimit", - "contract_address", - "contractAddress", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - GasLimit, - ContractAddress, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "gasLimit" | "gas_limit" => Ok(GeneratedField::GasLimit), - "contractAddress" | "contract_address" => { - Ok(GeneratedField::ContractAddress) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryEstimateTxFeesRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.QueryEstimateTxFeesRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut gas_limit__ = None; - let mut contract_address__ = None; - while let Some(k) = map.next_key()? { - match k { - 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::ContractAddress => { - if contract_address__.is_some() { - return Err(serde::de::Error::duplicate_field("contractAddress")); - } - contract_address__ = Some(map.next_value()?); - } - } - } - Ok(QueryEstimateTxFeesRequest { - gas_limit: gas_limit__.unwrap_or_default(), - contract_address: contract_address__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.QueryEstimateTxFeesRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryEstimateTxFeesResponse { - #[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_unit_price.is_some() { - len += 1; - } - if !self.estimated_fee.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.rewards.v1.QueryEstimateTxFeesResponse", len)?; - if let Some(v) = self.gas_unit_price.as_ref() { - struct_ser.serialize_field("gasUnitPrice", v)?; - } - if !self.estimated_fee.is_empty() { - struct_ser.serialize_field("estimatedFee", &self.estimated_fee)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryEstimateTxFeesResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "gas_unit_price", - "gasUnitPrice", - "estimated_fee", - "estimatedFee", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - GasUnitPrice, - EstimatedFee, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "gasUnitPrice" | "gas_unit_price" => Ok(GeneratedField::GasUnitPrice), - "estimatedFee" | "estimated_fee" => Ok(GeneratedField::EstimatedFee), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryEstimateTxFeesResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.QueryEstimateTxFeesResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut gas_unit_price__ = None; - let mut estimated_fee__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::GasUnitPrice => { - if gas_unit_price__.is_some() { - return Err(serde::de::Error::duplicate_field("gasUnitPrice")); - } - gas_unit_price__ = map.next_value()?; - } - GeneratedField::EstimatedFee => { - if estimated_fee__.is_some() { - return Err(serde::de::Error::duplicate_field("estimatedFee")); - } - estimated_fee__ = Some(map.next_value()?); - } - } - } - Ok(QueryEstimateTxFeesResponse { - gas_unit_price: gas_unit_price__, - estimated_fee: estimated_fee__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.QueryEstimateTxFeesResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryFlatFeeRequest { - #[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; - } - let mut struct_ser = - serializer.serialize_struct("archway.rewards.v1.QueryFlatFeeRequest", len)?; - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryFlatFeeRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["contract_address", "contractAddress"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ContractAddress, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryFlatFeeRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.QueryFlatFeeRequest") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut contract_address__ = 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()?); - } - } - } - Ok(QueryFlatFeeRequest { - contract_address: contract_address__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.QueryFlatFeeRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryFlatFeeResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.flat_fee_amount.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.rewards.v1.QueryFlatFeeResponse", len)?; - if let Some(v) = self.flat_fee_amount.as_ref() { - struct_ser.serialize_field("flatFeeAmount", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryFlatFeeResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["flat_fee_amount", "flatFeeAmount"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - FlatFeeAmount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "flatFeeAmount" | "flat_fee_amount" => { - Ok(GeneratedField::FlatFeeAmount) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryFlatFeeResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.QueryFlatFeeResponse") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut flat_fee_amount__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::FlatFeeAmount => { - if flat_fee_amount__.is_some() { - return Err(serde::de::Error::duplicate_field("flatFeeAmount")); - } - flat_fee_amount__ = map.next_value()?; - } - } - } - Ok(QueryFlatFeeResponse { - flat_fee_amount: flat_fee_amount__, - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.QueryFlatFeeResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryOutstandingRewardsRequest { - #[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_address.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("archway.rewards.v1.QueryOutstandingRewardsRequest", len)?; - if !self.rewards_address.is_empty() { - struct_ser.serialize_field("rewardsAddress", &self.rewards_address)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryOutstandingRewardsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["rewards_address", "rewardsAddress"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - RewardsAddress, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "rewardsAddress" | "rewards_address" => { - Ok(GeneratedField::RewardsAddress) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryOutstandingRewardsRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.QueryOutstandingRewardsRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut rewards_address__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::RewardsAddress => { - if rewards_address__.is_some() { - return Err(serde::de::Error::duplicate_field("rewardsAddress")); - } - rewards_address__ = Some(map.next_value()?); - } - } - } - Ok(QueryOutstandingRewardsRequest { - rewards_address: rewards_address__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.QueryOutstandingRewardsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryOutstandingRewardsResponse { - #[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_rewards.is_empty() { - len += 1; - } - if self.records_num != 0 { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("archway.rewards.v1.QueryOutstandingRewardsResponse", len)?; - if !self.total_rewards.is_empty() { - struct_ser.serialize_field("totalRewards", &self.total_rewards)?; - } - if self.records_num != 0 { - struct_ser.serialize_field( - "recordsNum", - ToString::to_string(&self.records_num).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryOutstandingRewardsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["total_rewards", "totalRewards", "records_num", "recordsNum"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - TotalRewards, - RecordsNum, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "totalRewards" | "total_rewards" => Ok(GeneratedField::TotalRewards), - "recordsNum" | "records_num" => Ok(GeneratedField::RecordsNum), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryOutstandingRewardsResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.QueryOutstandingRewardsResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut total_rewards__ = None; - let mut records_num__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::TotalRewards => { - if total_rewards__.is_some() { - return Err(serde::de::Error::duplicate_field("totalRewards")); - } - total_rewards__ = Some(map.next_value()?); - } - GeneratedField::RecordsNum => { - if records_num__.is_some() { - return Err(serde::de::Error::duplicate_field("recordsNum")); - } - records_num__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(QueryOutstandingRewardsResponse { - total_rewards: total_rewards__.unwrap_or_default(), - records_num: records_num__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.QueryOutstandingRewardsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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("archway.rewards.v1.QueryParamsRequest", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 archway.rewards.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( - "archway.rewards.v1.QueryParamsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -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("archway.rewards.v1.QueryParamsResponse", len)?; - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["params"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 archway.rewards.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( - "archway.rewards.v1.QueryParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryRewardsPoolRequest { - #[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("archway.rewards.v1.QueryRewardsPoolRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryRewardsPoolRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = QueryRewardsPoolRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.QueryRewardsPoolRequest") - } - - 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(QueryRewardsPoolRequest {}) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.QueryRewardsPoolRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryRewardsPoolResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.undistributed_funds.is_empty() { - len += 1; - } - if !self.treasury_funds.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.rewards.v1.QueryRewardsPoolResponse", len)?; - if !self.undistributed_funds.is_empty() { - struct_ser.serialize_field("undistributedFunds", &self.undistributed_funds)?; - } - if !self.treasury_funds.is_empty() { - struct_ser.serialize_field("treasuryFunds", &self.treasury_funds)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryRewardsPoolResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "undistributed_funds", - "undistributedFunds", - "treasury_funds", - "treasuryFunds", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - UndistributedFunds, - TreasuryFunds, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "undistributedFunds" | "undistributed_funds" => { - Ok(GeneratedField::UndistributedFunds) - } - "treasuryFunds" | "treasury_funds" => Ok(GeneratedField::TreasuryFunds), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryRewardsPoolResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.QueryRewardsPoolResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut undistributed_funds__ = None; - let mut treasury_funds__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::UndistributedFunds => { - if undistributed_funds__.is_some() { - return Err(serde::de::Error::duplicate_field( - "undistributedFunds", - )); - } - undistributed_funds__ = Some(map.next_value()?); - } - GeneratedField::TreasuryFunds => { - if treasury_funds__.is_some() { - return Err(serde::de::Error::duplicate_field("treasuryFunds")); - } - treasury_funds__ = Some(map.next_value()?); - } - } - } - Ok(QueryRewardsPoolResponse { - undistributed_funds: undistributed_funds__.unwrap_or_default(), - treasury_funds: treasury_funds__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.QueryRewardsPoolResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryRewardsRecordsRequest { - #[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_address.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.rewards.v1.QueryRewardsRecordsRequest", len)?; - if !self.rewards_address.is_empty() { - struct_ser.serialize_field("rewardsAddress", &self.rewards_address)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryRewardsRecordsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["rewards_address", "rewardsAddress", "pagination"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - RewardsAddress, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "rewardsAddress" | "rewards_address" => { - Ok(GeneratedField::RewardsAddress) - } - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryRewardsRecordsRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.QueryRewardsRecordsRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut rewards_address__ = None; - let mut pagination__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::RewardsAddress => { - if rewards_address__.is_some() { - return Err(serde::de::Error::duplicate_field("rewardsAddress")); - } - rewards_address__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - } - } - Ok(QueryRewardsRecordsRequest { - rewards_address: rewards_address__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.QueryRewardsRecordsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryRewardsRecordsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.records.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.rewards.v1.QueryRewardsRecordsResponse", len)?; - if !self.records.is_empty() { - struct_ser.serialize_field("records", &self.records)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryRewardsRecordsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["records", "pagination"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Records, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "records" => Ok(GeneratedField::Records), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryRewardsRecordsResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.QueryRewardsRecordsResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut records__ = None; - let mut pagination__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Records => { - if records__.is_some() { - return Err(serde::de::Error::duplicate_field("records")); - } - records__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - } - } - Ok(QueryRewardsRecordsResponse { - records: records__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.QueryRewardsRecordsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for RewardsRecord { - #[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.rewards_address.is_empty() { - len += 1; - } - if !self.rewards.is_empty() { - len += 1; - } - if self.calculated_height != 0 { - len += 1; - } - if self.calculated_time.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.rewards.v1.RewardsRecord", len)?; - if self.id != 0 { - struct_ser.serialize_field("id", ToString::to_string(&self.id).as_str())?; - } - if !self.rewards_address.is_empty() { - struct_ser.serialize_field("rewardsAddress", &self.rewards_address)?; - } - if !self.rewards.is_empty() { - struct_ser.serialize_field("rewards", &self.rewards)?; - } - if self.calculated_height != 0 { - struct_ser.serialize_field( - "calculatedHeight", - ToString::to_string(&self.calculated_height).as_str(), - )?; - } - if let Some(v) = self.calculated_time.as_ref() { - struct_ser.serialize_field("calculatedTime", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for RewardsRecord { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "id", - "rewards_address", - "rewardsAddress", - "rewards", - "calculated_height", - "calculatedHeight", - "calculated_time", - "calculatedTime", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Id, - RewardsAddress, - Rewards, - CalculatedHeight, - CalculatedTime, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "rewardsAddress" | "rewards_address" => { - Ok(GeneratedField::RewardsAddress) - } - "rewards" => Ok(GeneratedField::Rewards), - "calculatedHeight" | "calculated_height" => { - Ok(GeneratedField::CalculatedHeight) - } - "calculatedTime" | "calculated_time" => { - Ok(GeneratedField::CalculatedTime) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RewardsRecord; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.RewardsRecord") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut id__ = None; - let mut rewards_address__ = None; - let mut rewards__ = None; - let mut calculated_height__ = None; - let mut calculated_time__ = 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::RewardsAddress => { - if rewards_address__.is_some() { - return Err(serde::de::Error::duplicate_field("rewardsAddress")); - } - rewards_address__ = Some(map.next_value()?); - } - GeneratedField::Rewards => { - if rewards__.is_some() { - return Err(serde::de::Error::duplicate_field("rewards")); - } - rewards__ = Some(map.next_value()?); - } - GeneratedField::CalculatedHeight => { - if calculated_height__.is_some() { - return Err(serde::de::Error::duplicate_field("calculatedHeight")); - } - calculated_height__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::CalculatedTime => { - if calculated_time__.is_some() { - return Err(serde::de::Error::duplicate_field("calculatedTime")); - } - calculated_time__ = map.next_value()?; - } - } - } - Ok(RewardsRecord { - id: id__.unwrap_or_default(), - rewards_address: rewards_address__.unwrap_or_default(), - rewards: rewards__.unwrap_or_default(), - calculated_height: calculated_height__.unwrap_or_default(), - calculated_time: calculated_time__, - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.RewardsRecord", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for RewardsWithdrawEvent { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.reward_address.is_empty() { - len += 1; - } - if !self.rewards.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.rewards.v1.RewardsWithdrawEvent", len)?; - if !self.reward_address.is_empty() { - struct_ser.serialize_field("rewardAddress", &self.reward_address)?; - } - if !self.rewards.is_empty() { - struct_ser.serialize_field("rewards", &self.rewards)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for RewardsWithdrawEvent { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["reward_address", "rewardAddress", "rewards"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - RewardAddress, - Rewards, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "rewardAddress" | "reward_address" => Ok(GeneratedField::RewardAddress), - "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 = RewardsWithdrawEvent; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.RewardsWithdrawEvent") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut reward_address__ = None; - let mut rewards__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::RewardAddress => { - if reward_address__.is_some() { - return Err(serde::de::Error::duplicate_field("rewardAddress")); - } - reward_address__ = Some(map.next_value()?); - } - GeneratedField::Rewards => { - if rewards__.is_some() { - return Err(serde::de::Error::duplicate_field("rewards")); - } - rewards__ = Some(map.next_value()?); - } - } - } - Ok(RewardsWithdrawEvent { - reward_address: reward_address__.unwrap_or_default(), - rewards: rewards__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.rewards.v1.RewardsWithdrawEvent", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for TxRewards { - #[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_id != 0 { - len += 1; - } - if self.height != 0 { - len += 1; - } - if !self.fee_rewards.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("archway.rewards.v1.TxRewards", len)?; - if self.tx_id != 0 { - struct_ser.serialize_field("txId", ToString::to_string(&self.tx_id).as_str())?; - } - if self.height != 0 { - struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; - } - if !self.fee_rewards.is_empty() { - struct_ser.serialize_field("feeRewards", &self.fee_rewards)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TxRewards { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["tx_id", "txId", "height", "fee_rewards", "feeRewards"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - TxId, - Height, - FeeRewards, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "txId" | "tx_id" => Ok(GeneratedField::TxId), - "height" => Ok(GeneratedField::Height), - "feeRewards" | "fee_rewards" => Ok(GeneratedField::FeeRewards), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TxRewards; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.rewards.v1.TxRewards") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut tx_id__ = None; - let mut height__ = None; - let mut fee_rewards__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::TxId => { - if tx_id__.is_some() { - return Err(serde::de::Error::duplicate_field("txId")); - } - tx_id__ = 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, - ); - } - GeneratedField::FeeRewards => { - if fee_rewards__.is_some() { - return Err(serde::de::Error::duplicate_field("feeRewards")); - } - fee_rewards__ = Some(map.next_value()?); - } - } - } - Ok(TxRewards { - tx_id: tx_id__.unwrap_or_default(), - height: height__.unwrap_or_default(), - fee_rewards: fee_rewards__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("archway.rewards.v1.TxRewards", FIELDS, GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/archway.tracking.v1.rs b/packages/proto/src/gen/archway.tracking.v1.rs index 1ec081f..b5896e0 100644 --- a/packages/proto/src/gen/archway.tracking.v1.rs +++ b/packages/proto/src/gen/archway.tracking.v1.rs @@ -1,6 +1,7 @@ // @generated /// TxInfo keeps a transaction gas tracking data. /// Object is being created at the module EndBlocker. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxInfo { @@ -24,6 +25,7 @@ impl ::prost::Name for TxInfo { } /// ContractOperationInfo keeps a single contract operation gas consumption data. /// Object is being created by the IngestGasRecord call from the wasmd. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ContractOperationInfo { @@ -57,6 +59,7 @@ impl ::prost::Name for ContractOperationInfo { } } /// BlockTracking is the tracking information for a block. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BlockTracking { @@ -72,6 +75,7 @@ impl ::prost::Name for BlockTracking { } } /// TxTracking is the tracking information for a single transaction. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxTracking { @@ -91,7 +95,19 @@ impl ::prost::Name for TxTracking { } } /// ContractOperation denotes which operation consumed gas. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum ContractOperation { /// Invalid or unknown operation @@ -144,6 +160,7 @@ impl ContractOperation { } } /// GenesisState defines the initial state of the tracking module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -169,6 +186,7 @@ impl ::prost::Name for GenesisState { } } /// QueryBlockGasTrackingRequest is the request for Query.BlockGasTracking. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBlockGasTrackingRequest {} @@ -180,6 +198,7 @@ impl ::prost::Name for QueryBlockGasTrackingRequest { } } /// QueryBlockGasTrackingResponse is the response for Query.BlockGasTracking. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBlockGasTrackingResponse { @@ -592,6 +611,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x00, 0x08, 0x12, 0x03, 0x17, 0x1a, 0x3a, 0x0a, 0x0f, 0x0a, 0x08, 0x04, 0x01, 0x02, 0x00, 0x08, 0xe9, 0xfb, 0x03, 0x12, 0x03, 0x17, 0x1c, 0x38, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("archway.tracking.v1.serde.rs"); include!("archway.tracking.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/archway.tracking.v1.serde.rs b/packages/proto/src/gen/archway.tracking.v1.serde.rs deleted file mode 100644 index 20fe0b8..0000000 --- a/packages/proto/src/gen/archway.tracking.v1.serde.rs +++ /dev/null @@ -1,993 +0,0 @@ -// @generated -impl serde::Serialize for BlockTracking { - #[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; - } - let mut struct_ser = - serializer.serialize_struct("archway.tracking.v1.BlockTracking", len)?; - if !self.txs.is_empty() { - struct_ser.serialize_field("txs", &self.txs)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for BlockTracking { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["txs"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Txs, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = BlockTracking; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.tracking.v1.BlockTracking") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut txs__ = 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()?); - } - } - } - Ok(BlockTracking { - txs: txs__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.tracking.v1.BlockTracking", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ContractOperation { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Unspecified => "CONTRACT_OPERATION_UNSPECIFIED", - Self::Instantiation => "CONTRACT_OPERATION_INSTANTIATION", - Self::Execution => "CONTRACT_OPERATION_EXECUTION", - Self::Query => "CONTRACT_OPERATION_QUERY", - Self::Migrate => "CONTRACT_OPERATION_MIGRATE", - Self::Ibc => "CONTRACT_OPERATION_IBC", - Self::Sudo => "CONTRACT_OPERATION_SUDO", - Self::Reply => "CONTRACT_OPERATION_REPLY", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for ContractOperation { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "CONTRACT_OPERATION_UNSPECIFIED", - "CONTRACT_OPERATION_INSTANTIATION", - "CONTRACT_OPERATION_EXECUTION", - "CONTRACT_OPERATION_QUERY", - "CONTRACT_OPERATION_MIGRATE", - "CONTRACT_OPERATION_IBC", - "CONTRACT_OPERATION_SUDO", - "CONTRACT_OPERATION_REPLY", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ContractOperation; - - 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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ContractOperation::from_i32) - .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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ContractOperation::from_i32) - .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_OPERATION_UNSPECIFIED" => Ok(ContractOperation::Unspecified), - "CONTRACT_OPERATION_INSTANTIATION" => Ok(ContractOperation::Instantiation), - "CONTRACT_OPERATION_EXECUTION" => Ok(ContractOperation::Execution), - "CONTRACT_OPERATION_QUERY" => Ok(ContractOperation::Query), - "CONTRACT_OPERATION_MIGRATE" => Ok(ContractOperation::Migrate), - "CONTRACT_OPERATION_IBC" => Ok(ContractOperation::Ibc), - "CONTRACT_OPERATION_SUDO" => Ok(ContractOperation::Sudo), - "CONTRACT_OPERATION_REPLY" => Ok(ContractOperation::Reply), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for ContractOperationInfo { - #[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.tx_id != 0 { - len += 1; - } - if !self.contract_address.is_empty() { - len += 1; - } - if self.operation_type != 0 { - len += 1; - } - if self.vm_gas != 0 { - len += 1; - } - if self.sdk_gas != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.tracking.v1.ContractOperationInfo", len)?; - if self.id != 0 { - struct_ser.serialize_field("id", ToString::to_string(&self.id).as_str())?; - } - if self.tx_id != 0 { - struct_ser.serialize_field("txId", ToString::to_string(&self.tx_id).as_str())?; - } - if !self.contract_address.is_empty() { - struct_ser.serialize_field("contractAddress", &self.contract_address)?; - } - if self.operation_type != 0 { - let v = ContractOperation::from_i32(self.operation_type).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.operation_type)) - })?; - struct_ser.serialize_field("operationType", &v)?; - } - if self.vm_gas != 0 { - struct_ser.serialize_field("vmGas", ToString::to_string(&self.vm_gas).as_str())?; - } - if self.sdk_gas != 0 { - struct_ser.serialize_field("sdkGas", ToString::to_string(&self.sdk_gas).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ContractOperationInfo { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "id", - "tx_id", - "txId", - "contract_address", - "contractAddress", - "operation_type", - "operationType", - "vm_gas", - "vmGas", - "sdk_gas", - "sdkGas", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Id, - TxId, - ContractAddress, - OperationType, - VmGas, - SdkGas, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "txId" | "tx_id" => Ok(GeneratedField::TxId), - "contractAddress" | "contract_address" => { - Ok(GeneratedField::ContractAddress) - } - "operationType" | "operation_type" => Ok(GeneratedField::OperationType), - "vmGas" | "vm_gas" => Ok(GeneratedField::VmGas), - "sdkGas" | "sdk_gas" => Ok(GeneratedField::SdkGas), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ContractOperationInfo; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.tracking.v1.ContractOperationInfo") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut id__ = None; - let mut tx_id__ = None; - let mut contract_address__ = None; - let mut operation_type__ = None; - let mut vm_gas__ = None; - let mut sdk_gas__ = 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::TxId => { - if tx_id__.is_some() { - return Err(serde::de::Error::duplicate_field("txId")); - } - tx_id__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::ContractAddress => { - if contract_address__.is_some() { - return Err(serde::de::Error::duplicate_field("contractAddress")); - } - contract_address__ = Some(map.next_value()?); - } - GeneratedField::OperationType => { - if operation_type__.is_some() { - return Err(serde::de::Error::duplicate_field("operationType")); - } - operation_type__ = Some(map.next_value::()? as i32); - } - GeneratedField::VmGas => { - if vm_gas__.is_some() { - return Err(serde::de::Error::duplicate_field("vmGas")); - } - vm_gas__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::SdkGas => { - if sdk_gas__.is_some() { - return Err(serde::de::Error::duplicate_field("sdkGas")); - } - sdk_gas__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(ContractOperationInfo { - id: id__.unwrap_or_default(), - tx_id: tx_id__.unwrap_or_default(), - contract_address: contract_address__.unwrap_or_default(), - operation_type: operation_type__.unwrap_or_default(), - vm_gas: vm_gas__.unwrap_or_default(), - sdk_gas: sdk_gas__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.tracking.v1.ContractOperationInfo", - FIELDS, - GeneratedVisitor, - ) - } -} -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.tx_info_last_id != 0 { - len += 1; - } - if !self.tx_infos.is_empty() { - len += 1; - } - if self.contract_op_info_last_id != 0 { - len += 1; - } - if !self.contract_op_infos.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("archway.tracking.v1.GenesisState", len)?; - if self.tx_info_last_id != 0 { - struct_ser.serialize_field( - "txInfoLastId", - ToString::to_string(&self.tx_info_last_id).as_str(), - )?; - } - if !self.tx_infos.is_empty() { - struct_ser.serialize_field("txInfos", &self.tx_infos)?; - } - if self.contract_op_info_last_id != 0 { - struct_ser.serialize_field( - "contractOpInfoLastId", - ToString::to_string(&self.contract_op_info_last_id).as_str(), - )?; - } - if !self.contract_op_infos.is_empty() { - struct_ser.serialize_field("contractOpInfos", &self.contract_op_infos)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GenesisState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "tx_info_last_id", - "txInfoLastId", - "tx_infos", - "txInfos", - "contract_op_info_last_id", - "contractOpInfoLastId", - "contract_op_infos", - "contractOpInfos", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - TxInfoLastId, - TxInfos, - ContractOpInfoLastId, - ContractOpInfos, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "txInfoLastId" | "tx_info_last_id" => Ok(GeneratedField::TxInfoLastId), - "txInfos" | "tx_infos" => Ok(GeneratedField::TxInfos), - "contractOpInfoLastId" | "contract_op_info_last_id" => { - Ok(GeneratedField::ContractOpInfoLastId) - } - "contractOpInfos" | "contract_op_infos" => { - Ok(GeneratedField::ContractOpInfos) - } - _ => 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 archway.tracking.v1.GenesisState") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut tx_info_last_id__ = None; - let mut tx_infos__ = None; - let mut contract_op_info_last_id__ = None; - let mut contract_op_infos__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::TxInfoLastId => { - if tx_info_last_id__.is_some() { - return Err(serde::de::Error::duplicate_field("txInfoLastId")); - } - tx_info_last_id__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::TxInfos => { - if tx_infos__.is_some() { - return Err(serde::de::Error::duplicate_field("txInfos")); - } - tx_infos__ = Some(map.next_value()?); - } - GeneratedField::ContractOpInfoLastId => { - if contract_op_info_last_id__.is_some() { - return Err(serde::de::Error::duplicate_field( - "contractOpInfoLastId", - )); - } - contract_op_info_last_id__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::ContractOpInfos => { - if contract_op_infos__.is_some() { - return Err(serde::de::Error::duplicate_field("contractOpInfos")); - } - contract_op_infos__ = Some(map.next_value()?); - } - } - } - Ok(GenesisState { - tx_info_last_id: tx_info_last_id__.unwrap_or_default(), - tx_infos: tx_infos__.unwrap_or_default(), - contract_op_info_last_id: contract_op_info_last_id__.unwrap_or_default(), - contract_op_infos: contract_op_infos__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "archway.tracking.v1.GenesisState", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryBlockGasTrackingRequest { - #[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("archway.tracking.v1.QueryBlockGasTrackingRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryBlockGasTrackingRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = QueryBlockGasTrackingRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.tracking.v1.QueryBlockGasTrackingRequest") - } - - 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(QueryBlockGasTrackingRequest {}) - } - } - deserializer.deserialize_struct( - "archway.tracking.v1.QueryBlockGasTrackingRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryBlockGasTrackingResponse { - #[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.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("archway.tracking.v1.QueryBlockGasTrackingResponse", len)?; - if let Some(v) = self.block.as_ref() { - struct_ser.serialize_field("block", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryBlockGasTrackingResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["block"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Block, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "block" => Ok(GeneratedField::Block), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryBlockGasTrackingResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.tracking.v1.QueryBlockGasTrackingResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut block__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Block => { - if block__.is_some() { - return Err(serde::de::Error::duplicate_field("block")); - } - block__ = map.next_value()?; - } - } - } - Ok(QueryBlockGasTrackingResponse { block: block__ }) - } - } - deserializer.deserialize_struct( - "archway.tracking.v1.QueryBlockGasTrackingResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for TxInfo { - #[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.height != 0 { - len += 1; - } - if self.total_gas != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("archway.tracking.v1.TxInfo", len)?; - if self.id != 0 { - struct_ser.serialize_field("id", ToString::to_string(&self.id).as_str())?; - } - if self.height != 0 { - struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; - } - if self.total_gas != 0 { - struct_ser - .serialize_field("totalGas", ToString::to_string(&self.total_gas).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TxInfo { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["id", "height", "total_gas", "totalGas"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Id, - Height, - TotalGas, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "height" => Ok(GeneratedField::Height), - "totalGas" | "total_gas" => Ok(GeneratedField::TotalGas), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TxInfo; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.tracking.v1.TxInfo") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut id__ = None; - let mut height__ = None; - let mut total_gas__ = 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::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); - } - height__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::TotalGas => { - if total_gas__.is_some() { - return Err(serde::de::Error::duplicate_field("totalGas")); - } - total_gas__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(TxInfo { - id: id__.unwrap_or_default(), - height: height__.unwrap_or_default(), - total_gas: total_gas__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("archway.tracking.v1.TxInfo", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for TxTracking { - #[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; - } - if !self.contract_operations.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("archway.tracking.v1.TxTracking", len)?; - if let Some(v) = self.info.as_ref() { - struct_ser.serialize_field("info", v)?; - } - if !self.contract_operations.is_empty() { - struct_ser.serialize_field("contractOperations", &self.contract_operations)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TxTracking { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["info", "contract_operations", "contractOperations"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Info, - ContractOperations, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "contractOperations" | "contract_operations" => { - Ok(GeneratedField::ContractOperations) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TxTracking; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct archway.tracking.v1.TxTracking") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut info__ = None; - let mut contract_operations__ = 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()?; - } - GeneratedField::ContractOperations => { - if contract_operations__.is_some() { - return Err(serde::de::Error::duplicate_field( - "contractOperations", - )); - } - contract_operations__ = Some(map.next_value()?); - } - } - } - Ok(TxTracking { - info: info__, - contract_operations: contract_operations__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("archway.tracking.v1.TxTracking", FIELDS, GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/cosmos.app.runtime.v1alpha1.rs b/packages/proto/src/gen/cosmos.app.runtime.v1alpha1.rs index e07cc11..e179b6d 100644 --- a/packages/proto/src/gen/cosmos.app.runtime.v1alpha1.rs +++ b/packages/proto/src/gen/cosmos.app.runtime.v1alpha1.rs @@ -1,5 +1,6 @@ // @generated /// Module is the config object for the runtime module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module { @@ -40,6 +41,7 @@ impl ::prost::Name for Module { } /// StoreKeyConfig may be supplied to override the default module store key, which /// is the module name. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreKeyConfig { @@ -211,5 +213,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x01, 0x01, 0x12, 0x03, 0x30, 0x09, 0x15, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x01, 0x03, 0x12, 0x03, 0x30, 0x18, 0x19, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.app.runtime.v1alpha1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.app.runtime.v1alpha1.serde.rs b/packages/proto/src/gen/cosmos.app.runtime.v1alpha1.serde.rs deleted file mode 100644 index 1703cb7..0000000 --- a/packages/proto/src/gen/cosmos.app.runtime.v1alpha1.serde.rs +++ /dev/null @@ -1,306 +0,0 @@ -// @generated -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.app_name.is_empty() { - len += 1; - } - if !self.begin_blockers.is_empty() { - len += 1; - } - if !self.end_blockers.is_empty() { - len += 1; - } - if !self.init_genesis.is_empty() { - len += 1; - } - if !self.export_genesis.is_empty() { - len += 1; - } - if !self.override_store_keys.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.app.runtime.v1alpha1.Module", len)?; - if !self.app_name.is_empty() { - struct_ser.serialize_field("appName", &self.app_name)?; - } - if !self.begin_blockers.is_empty() { - struct_ser.serialize_field("beginBlockers", &self.begin_blockers)?; - } - if !self.end_blockers.is_empty() { - struct_ser.serialize_field("endBlockers", &self.end_blockers)?; - } - if !self.init_genesis.is_empty() { - struct_ser.serialize_field("initGenesis", &self.init_genesis)?; - } - if !self.export_genesis.is_empty() { - struct_ser.serialize_field("exportGenesis", &self.export_genesis)?; - } - if !self.override_store_keys.is_empty() { - struct_ser.serialize_field("overrideStoreKeys", &self.override_store_keys)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Module { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "app_name", - "appName", - "begin_blockers", - "beginBlockers", - "end_blockers", - "endBlockers", - "init_genesis", - "initGenesis", - "export_genesis", - "exportGenesis", - "override_store_keys", - "overrideStoreKeys", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - AppName, - BeginBlockers, - EndBlockers, - InitGenesis, - ExportGenesis, - OverrideStoreKeys, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "appName" | "app_name" => Ok(GeneratedField::AppName), - "beginBlockers" | "begin_blockers" => Ok(GeneratedField::BeginBlockers), - "endBlockers" | "end_blockers" => Ok(GeneratedField::EndBlockers), - "initGenesis" | "init_genesis" => Ok(GeneratedField::InitGenesis), - "exportGenesis" | "export_genesis" => Ok(GeneratedField::ExportGenesis), - "overrideStoreKeys" | "override_store_keys" => { - Ok(GeneratedField::OverrideStoreKeys) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Module; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.app.runtime.v1alpha1.Module") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut app_name__ = None; - let mut begin_blockers__ = None; - let mut end_blockers__ = None; - let mut init_genesis__ = None; - let mut export_genesis__ = None; - let mut override_store_keys__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::AppName => { - if app_name__.is_some() { - return Err(serde::de::Error::duplicate_field("appName")); - } - app_name__ = Some(map.next_value()?); - } - GeneratedField::BeginBlockers => { - if begin_blockers__.is_some() { - return Err(serde::de::Error::duplicate_field("beginBlockers")); - } - begin_blockers__ = Some(map.next_value()?); - } - GeneratedField::EndBlockers => { - if end_blockers__.is_some() { - return Err(serde::de::Error::duplicate_field("endBlockers")); - } - end_blockers__ = Some(map.next_value()?); - } - GeneratedField::InitGenesis => { - if init_genesis__.is_some() { - return Err(serde::de::Error::duplicate_field("initGenesis")); - } - init_genesis__ = Some(map.next_value()?); - } - GeneratedField::ExportGenesis => { - if export_genesis__.is_some() { - return Err(serde::de::Error::duplicate_field("exportGenesis")); - } - export_genesis__ = Some(map.next_value()?); - } - GeneratedField::OverrideStoreKeys => { - if override_store_keys__.is_some() { - return Err(serde::de::Error::duplicate_field("overrideStoreKeys")); - } - override_store_keys__ = Some(map.next_value()?); - } - } - } - Ok(Module { - app_name: app_name__.unwrap_or_default(), - begin_blockers: begin_blockers__.unwrap_or_default(), - end_blockers: end_blockers__.unwrap_or_default(), - init_genesis: init_genesis__.unwrap_or_default(), - export_genesis: export_genesis__.unwrap_or_default(), - override_store_keys: override_store_keys__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.app.runtime.v1alpha1.Module", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for StoreKeyConfig { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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.kv_store_key.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.app.runtime.v1alpha1.StoreKeyConfig", len)?; - if !self.module_name.is_empty() { - struct_ser.serialize_field("moduleName", &self.module_name)?; - } - if !self.kv_store_key.is_empty() { - struct_ser.serialize_field("kvStoreKey", &self.kv_store_key)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for StoreKeyConfig { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["module_name", "moduleName", "kv_store_key", "kvStoreKey"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ModuleName, - KvStoreKey, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "kvStoreKey" | "kv_store_key" => Ok(GeneratedField::KvStoreKey), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StoreKeyConfig; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.app.runtime.v1alpha1.StoreKeyConfig") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut module_name__ = None; - let mut kv_store_key__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ModuleName => { - if module_name__.is_some() { - return Err(serde::de::Error::duplicate_field("moduleName")); - } - module_name__ = Some(map.next_value()?); - } - GeneratedField::KvStoreKey => { - if kv_store_key__.is_some() { - return Err(serde::de::Error::duplicate_field("kvStoreKey")); - } - kv_store_key__ = Some(map.next_value()?); - } - } - } - Ok(StoreKeyConfig { - module_name: module_name__.unwrap_or_default(), - kv_store_key: kv_store_key__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.app.runtime.v1alpha1.StoreKeyConfig", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/cosmos.app.v1alpha1.rs b/packages/proto/src/gen/cosmos.app.v1alpha1.rs index dfcf572..a46f454 100644 --- a/packages/proto/src/gen/cosmos.app.v1alpha1.rs +++ b/packages/proto/src/gen/cosmos.app.v1alpha1.rs @@ -1,5 +1,6 @@ // @generated /// ModuleDescriptor describes an app module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleDescriptor { @@ -32,6 +33,7 @@ impl ::prost::Name for ModuleDescriptor { } } /// PackageReference is a reference to a protobuf package used by a module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PackageReference { @@ -85,6 +87,7 @@ impl ::prost::Name for PackageReference { } /// MigrateFromInfo is information on a module version that a newer module /// can migrate from. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MigrateFromInfo { @@ -107,6 +110,7 @@ impl ::prost::Name for 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Config { @@ -127,6 +131,7 @@ impl ::prost::Name for Config { } } /// ModuleConfig is a module configuration for an app. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleConfig { @@ -160,6 +165,7 @@ impl ::prost::Name for ModuleConfig { } } /// GolangBinding is an explicit interface type to implementing type binding for dependency injection. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GolangBinding { @@ -178,6 +184,7 @@ impl ::prost::Name for GolangBinding { } } /// QueryConfigRequest is the Query/Config request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConfigRequest {} @@ -189,6 +196,7 @@ impl ::prost::Name for QueryConfigRequest { } } /// QueryConfigRequest is the Query/Config response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConfigResponse { @@ -759,6 +767,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x00, 0x03, 0x12, 0x03, 0x14, 0x12, 0x13, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.app.v1alpha1.serde.rs"); include!("cosmos.app.v1alpha1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.app.v1alpha1.serde.rs b/packages/proto/src/gen/cosmos.app.v1alpha1.serde.rs deleted file mode 100644 index c857b5e..0000000 --- a/packages/proto/src/gen/cosmos.app.v1alpha1.serde.rs +++ /dev/null @@ -1,877 +0,0 @@ -// @generated -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; - } - if !self.golang_bindings.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)?; - } - if !self.golang_bindings.is_empty() { - struct_ser.serialize_field("golangBindings", &self.golang_bindings)?; - } - struct_ser.end() - } -} -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", "golang_bindings", "golangBindings"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Modules, - GolangBindings, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "golangBindings" | "golang_bindings" => { - Ok(GeneratedField::GolangBindings) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Config; - - fn expecting(&self, formatter: &mut 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; - let mut golang_bindings__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Modules => { - if modules__.is_some() { - return Err(serde::de::Error::duplicate_field("modules")); - } - modules__ = Some(map.next_value()?); - } - GeneratedField::GolangBindings => { - if golang_bindings__.is_some() { - return Err(serde::de::Error::duplicate_field("golangBindings")); - } - golang_bindings__ = Some(map.next_value()?); - } - } - } - Ok(Config { - modules: modules__.unwrap_or_default(), - golang_bindings: golang_bindings__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.app.v1alpha1.Config", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for GolangBinding { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.interface_type.is_empty() { - len += 1; - } - if !self.implementation.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.app.v1alpha1.GolangBinding", len)?; - if !self.interface_type.is_empty() { - struct_ser.serialize_field("interfaceType", &self.interface_type)?; - } - if !self.implementation.is_empty() { - struct_ser.serialize_field("implementation", &self.implementation)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GolangBinding { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["interface_type", "interfaceType", "implementation"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - InterfaceType, - Implementation, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "interfaceType" | "interface_type" => Ok(GeneratedField::InterfaceType), - "implementation" => Ok(GeneratedField::Implementation), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GolangBinding; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.app.v1alpha1.GolangBinding") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut interface_type__ = None; - let mut implementation__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::InterfaceType => { - if interface_type__.is_some() { - return Err(serde::de::Error::duplicate_field("interfaceType")); - } - interface_type__ = Some(map.next_value()?); - } - GeneratedField::Implementation => { - if implementation__.is_some() { - return Err(serde::de::Error::duplicate_field("implementation")); - } - implementation__ = Some(map.next_value()?); - } - } - } - Ok(GolangBinding { - interface_type: interface_type__.unwrap_or_default(), - implementation: implementation__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.app.v1alpha1.GolangBinding", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MigrateFromInfo { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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; - } - if !self.golang_bindings.is_empty() { - 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)?; - } - if !self.golang_bindings.is_empty() { - struct_ser.serialize_field("golangBindings", &self.golang_bindings)?; - } - struct_ser.end() - } -} -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", "golang_bindings", "golangBindings"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Name, - Config, - GolangBindings, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "golangBindings" | "golang_bindings" => { - Ok(GeneratedField::GolangBindings) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ModuleConfig; - - fn expecting(&self, formatter: &mut 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; - let mut golang_bindings__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map.next_value()?); - } - GeneratedField::Config => { - if config__.is_some() { - return Err(serde::de::Error::duplicate_field("config")); - } - config__ = map.next_value()?; - } - GeneratedField::GolangBindings => { - if golang_bindings__.is_some() { - return Err(serde::de::Error::duplicate_field("golangBindings")); - } - golang_bindings__ = Some(map.next_value()?); - } - } - } - Ok(ModuleConfig { - name: name__.unwrap_or_default(), - config: config__, - golang_bindings: golang_bindings__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.app.v1alpha1.ModuleConfig", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ModuleDescriptor { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.auth.module.v1.rs b/packages/proto/src/gen/cosmos.auth.module.v1.rs index 9e99021..aaf47dd 100644 --- a/packages/proto/src/gen/cosmos.auth.module.v1.rs +++ b/packages/proto/src/gen/cosmos.auth.module.v1.rs @@ -1,5 +1,6 @@ // @generated /// Module is the config object for the auth module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module { @@ -21,6 +22,7 @@ impl ::prost::Name for Module { } } /// ModuleAccountPermission represents permissions for a module account. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleAccountPermission { @@ -129,5 +131,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x01, 0x01, 0x12, 0x03, 0x1d, 0x12, 0x1d, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x01, 0x03, 0x12, 0x03, 0x1d, 0x20, 0x21, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.auth.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.auth.module.v1.serde.rs b/packages/proto/src/gen/cosmos.auth.module.v1.serde.rs deleted file mode 100644 index 6b52396..0000000 --- a/packages/proto/src/gen/cosmos.auth.module.v1.serde.rs +++ /dev/null @@ -1,252 +0,0 @@ -// @generated -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.bech32_prefix.is_empty() { - len += 1; - } - if !self.module_account_permissions.is_empty() { - len += 1; - } - if !self.authority.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.auth.module.v1.Module", len)?; - if !self.bech32_prefix.is_empty() { - struct_ser.serialize_field("bech32Prefix", &self.bech32_prefix)?; - } - if !self.module_account_permissions.is_empty() { - struct_ser - .serialize_field("moduleAccountPermissions", &self.module_account_permissions)?; - } - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Module { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "bech32_prefix", - "bech32Prefix", - "module_account_permissions", - "moduleAccountPermissions", - "authority", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Bech32Prefix, - ModuleAccountPermissions, - Authority, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "moduleAccountPermissions" | "module_account_permissions" => { - Ok(GeneratedField::ModuleAccountPermissions) - } - "authority" => Ok(GeneratedField::Authority), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Module; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.auth.module.v1.Module") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut bech32_prefix__ = None; - let mut module_account_permissions__ = None; - let mut authority__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Bech32Prefix => { - if bech32_prefix__.is_some() { - return Err(serde::de::Error::duplicate_field("bech32Prefix")); - } - bech32_prefix__ = Some(map.next_value()?); - } - GeneratedField::ModuleAccountPermissions => { - if module_account_permissions__.is_some() { - return Err(serde::de::Error::duplicate_field( - "moduleAccountPermissions", - )); - } - module_account_permissions__ = Some(map.next_value()?); - } - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map.next_value()?); - } - } - } - Ok(Module { - bech32_prefix: bech32_prefix__.unwrap_or_default(), - module_account_permissions: module_account_permissions__.unwrap_or_default(), - authority: authority__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.auth.module.v1.Module", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ModuleAccountPermission { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.account.is_empty() { - len += 1; - } - if !self.permissions.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.auth.module.v1.ModuleAccountPermission", len)?; - if !self.account.is_empty() { - struct_ser.serialize_field("account", &self.account)?; - } - if !self.permissions.is_empty() { - struct_ser.serialize_field("permissions", &self.permissions)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ModuleAccountPermission { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["account", "permissions"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Account, - Permissions, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "permissions" => Ok(GeneratedField::Permissions), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ModuleAccountPermission; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.auth.module.v1.ModuleAccountPermission") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut account__ = None; - let mut permissions__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Account => { - if account__.is_some() { - return Err(serde::de::Error::duplicate_field("account")); - } - account__ = Some(map.next_value()?); - } - GeneratedField::Permissions => { - if permissions__.is_some() { - return Err(serde::de::Error::duplicate_field("permissions")); - } - permissions__ = Some(map.next_value()?); - } - } - } - Ok(ModuleAccountPermission { - account: account__.unwrap_or_default(), - permissions: permissions__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.auth.module.v1.ModuleAccountPermission", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/cosmos.auth.v1beta1.rs b/packages/proto/src/gen/cosmos.auth.v1beta1.rs index 6a8a8e6..8490cf1 100644 --- a/packages/proto/src/gen/cosmos.auth.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.auth.v1beta1.rs @@ -2,6 +2,7 @@ /// 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). +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BaseAccount { @@ -22,6 +23,7 @@ impl ::prost::Name for BaseAccount { } } /// ModuleAccount defines an account for modules that holds coins on a pool. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleAccount { @@ -42,6 +44,7 @@ impl ::prost::Name for ModuleAccount { /// ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleCredential { @@ -61,6 +64,7 @@ impl ::prost::Name for ModuleCredential { } } /// Params defines the parameters for the auth module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -83,6 +87,7 @@ impl ::prost::Name for Params { } } /// GenesisState defines the auth module's genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -103,6 +108,7 @@ impl ::prost::Name for GenesisState { /// QueryAccountsRequest is the request type for the Query/Accounts RPC method. /// /// Since: cosmos-sdk 0.43 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountsRequest { @@ -120,6 +126,7 @@ impl ::prost::Name for QueryAccountsRequest { /// QueryAccountsResponse is the response type for the Query/Accounts RPC method. /// /// Since: cosmos-sdk 0.43 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountsResponse { @@ -138,6 +145,7 @@ impl ::prost::Name for QueryAccountsResponse { } } /// QueryAccountRequest is the request type for the Query/Account RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountRequest { @@ -153,6 +161,7 @@ impl ::prost::Name for QueryAccountRequest { } } /// QueryAccountResponse is the response type for the Query/Account RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountResponse { @@ -168,6 +177,7 @@ impl ::prost::Name for QueryAccountResponse { } } /// QueryParamsRequest is the request type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} @@ -179,6 +189,7 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse is the response type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -196,6 +207,7 @@ impl ::prost::Name for QueryParamsResponse { /// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleAccountsRequest {} @@ -209,6 +221,7 @@ impl ::prost::Name for QueryModuleAccountsRequest { /// QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleAccountsResponse { @@ -223,6 +236,7 @@ impl ::prost::Name for QueryModuleAccountsResponse { } } /// QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleAccountByNameRequest { @@ -237,6 +251,7 @@ impl ::prost::Name for QueryModuleAccountByNameRequest { } } /// QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleAccountByNameResponse { @@ -253,6 +268,7 @@ impl ::prost::Name for QueryModuleAccountByNameResponse { /// Bech32PrefixRequest is the request type for Bech32Prefix rpc method. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Bech32PrefixRequest {} @@ -266,6 +282,7 @@ impl ::prost::Name for Bech32PrefixRequest { /// Bech32PrefixResponse is the response type for Bech32Prefix rpc method. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Bech32PrefixResponse { @@ -282,6 +299,7 @@ impl ::prost::Name for Bech32PrefixResponse { /// AddressBytesToStringRequest is the request type for AddressString rpc method. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddressBytesToStringRequest { @@ -298,6 +316,7 @@ impl ::prost::Name for AddressBytesToStringRequest { /// AddressBytesToStringResponse is the response type for AddressString rpc method. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddressBytesToStringResponse { @@ -314,6 +333,7 @@ impl ::prost::Name for AddressBytesToStringResponse { /// AddressStringToBytesRequest is the request type for AccountBytes rpc method. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddressStringToBytesRequest { @@ -330,6 +350,7 @@ impl ::prost::Name for AddressStringToBytesRequest { /// AddressStringToBytesResponse is the response type for AddressBytes rpc method. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddressStringToBytesResponse { @@ -346,6 +367,7 @@ impl ::prost::Name for AddressStringToBytesResponse { /// QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method /// /// Since: cosmos-sdk 0.46.2 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountAddressByIdRequest { @@ -373,6 +395,7 @@ impl ::prost::Name for QueryAccountAddressByIdRequest { /// QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method /// /// Since: cosmos-sdk 0.46.2 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountAddressByIdResponse { @@ -389,6 +412,7 @@ impl ::prost::Name for QueryAccountAddressByIdResponse { /// QueryAccountInfoRequest is the Query/AccountInfo request type. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountInfoRequest { @@ -406,6 +430,7 @@ impl ::prost::Name for QueryAccountInfoRequest { /// QueryAccountInfoResponse is the Query/AccountInfo response type. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountInfoResponse { @@ -423,6 +448,7 @@ impl ::prost::Name for QueryAccountInfoResponse { /// MsgUpdateParams is the Msg/UpdateParams request type. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -446,6 +472,7 @@ impl ::prost::Name for MsgUpdateParams { /// MsgUpdateParams message. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} @@ -1478,6 +1505,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x30, 0x2e, 0x34, 0x37, 0x0a, 0x0a, 0x0a, 0x0a, 0x03, 0x04, 0x01, 0x01, 0x12, 0x03, 0x2a, 0x08, 0x1f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.auth.v1beta1.serde.rs"); include!("cosmos.auth.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.auth.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.auth.v1beta1.serde.rs deleted file mode 100644 index 9aa7349..0000000 --- a/packages/proto/src/gen/cosmos.auth.v1beta1.serde.rs +++ /dev/null @@ -1,2893 +0,0 @@ -// @generated -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() { - struct_ser.serialize_field( - "addressBytes", - pbjson::private::base64::encode(&self.address_bytes).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for AddressBytesToStringRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["address_bytes", "addressBytes"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - AddressBytes, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser.serialize_field( - "addressBytes", - pbjson::private::base64::encode(&self.address_bytes).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for AddressStringToBytesResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["address_bytes", "addressBytes"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - AddressBytes, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field( - "accountNumber", - ToString::to_string(&self.account_number).as_str(), - )?; - } - if self.sequence != 0 { - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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("cosmos.auth.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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 cosmos.auth.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( - "cosmos.auth.v1beta1.MsgUpdateParams", - FIELDS, - GeneratedVisitor, - ) - } -} -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("cosmos.auth.v1beta1.MsgUpdateParamsResponse", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 cosmos.auth.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( - "cosmos.auth.v1beta1.MsgUpdateParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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 { - struct_ser.serialize_field( - "maxMemoCharacters", - ToString::to_string(&self.max_memo_characters).as_str(), - )?; - } - if self.tx_sig_limit != 0 { - struct_ser.serialize_field( - "txSigLimit", - ToString::to_string(&self.tx_sig_limit).as_str(), - )?; - } - if self.tx_size_cost_per_byte != 0 { - struct_ser.serialize_field( - "txSizeCostPerByte", - ToString::to_string(&self.tx_size_cost_per_byte).as_str(), - )?; - } - if self.sig_verify_cost_ed25519 != 0 { - struct_ser.serialize_field( - "sigVerifyCostEd25519", - ToString::to_string(&self.sig_verify_cost_ed25519).as_str(), - )?; - } - if self.sig_verify_cost_secp256k1 != 0 { - struct_ser.serialize_field( - "sigVerifyCostSecp256k1", - ToString::to_string(&self.sig_verify_cost_secp256k1).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Params { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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; - } - if self.account_id != 0 { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("cosmos.auth.v1beta1.QueryAccountAddressByIDRequest", len)?; - if self.id != 0 { - struct_ser.serialize_field("id", ToString::to_string(&self.id).as_str())?; - } - if self.account_id != 0 { - struct_ser - .serialize_field("accountId", ToString::to_string(&self.account_id).as_str())?; - } - struct_ser.end() - } -} -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", "account_id", "accountId"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Id, - AccountId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "accountId" | "account_id" => Ok(GeneratedField::AccountId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryAccountAddressByIdRequest; - - fn expecting(&self, formatter: &mut 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; - let mut account_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Id => { - if id__.is_some() { - return Err(serde::de::Error::duplicate_field("id")); - } - id__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::AccountId => { - if account_id__.is_some() { - return Err(serde::de::Error::duplicate_field("accountId")); - } - account_id__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(QueryAccountAddressByIdRequest { - id: id__.unwrap_or_default(), - account_id: account_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.auth.v1beta1.QueryAccountAddressByIDRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryAccountAddressByIdResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -impl serde::Serialize for QueryAccountInfoRequest { - #[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.QueryAccountInfoRequest", len)?; - if !self.address.is_empty() { - struct_ser.serialize_field("address", &self.address)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryAccountInfoRequest { - #[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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = QueryAccountInfoRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountInfoRequest") - } - - 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(QueryAccountInfoRequest { - address: address__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.auth.v1beta1.QueryAccountInfoRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryAccountInfoResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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.auth.v1beta1.QueryAccountInfoResponse", len)?; - if let Some(v) = self.info.as_ref() { - struct_ser.serialize_field("info", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryAccountInfoResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["info"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Info, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = QueryAccountInfoResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountInfoResponse") - } - - 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(QueryAccountInfoResponse { info: info__ }) - } - } - deserializer.deserialize_struct( - "cosmos.auth.v1beta1.QueryAccountInfoResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.authz.module.v1.rs b/packages/proto/src/gen/cosmos.authz.module.v1.rs index 87ece49..a5e4445 100644 --- a/packages/proto/src/gen/cosmos.authz.module.v1.rs +++ b/packages/proto/src/gen/cosmos.authz.module.v1.rs @@ -1,5 +1,6 @@ // @generated /// Module is the config object of the authz module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module {} @@ -36,5 +37,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x0a, 0x08, 0x04, 0x00, 0x07, 0x87, 0xe8, 0xa2, 0x1b, 0x01, 0x12, 0x03, 0x09, 0x04, 0x35, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.authz.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.authz.module.v1.serde.rs b/packages/proto/src/gen/cosmos.authz.module.v1.serde.rs deleted file mode 100644 index 1962113..0000000 --- a/packages/proto/src/gen/cosmos.authz.module.v1.serde.rs +++ /dev/null @@ -1,72 +0,0 @@ -// @generated -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.authz.module.v1.Module", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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.authz.module.v1.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.authz.module.v1.Module", FIELDS, GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/cosmos.authz.v1beta1.rs b/packages/proto/src/gen/cosmos.authz.v1beta1.rs index 5217b06..f1d32b2 100644 --- a/packages/proto/src/gen/cosmos.authz.v1beta1.rs +++ b/packages/proto/src/gen/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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenericAuthorization { @@ -17,6 +18,7 @@ impl ::prost::Name for GenericAuthorization { } /// Grant gives permissions to execute /// the provide method with expiration time. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Grant { @@ -37,6 +39,7 @@ impl ::prost::Name for Grant { } /// GrantAuthorization extends a grant with both the addresses of the grantee and granter. /// It is used in genesis.proto and query.proto +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GrantAuthorization { @@ -57,6 +60,7 @@ impl ::prost::Name for GrantAuthorization { } } /// GrantQueueItem contains the list of TypeURL of a sdk.Msg. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GrantQueueItem { @@ -72,6 +76,7 @@ impl ::prost::Name for GrantQueueItem { } } /// EventGrant is emitted on Msg/Grant +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventGrant { @@ -93,6 +98,7 @@ impl ::prost::Name for EventGrant { } } /// EventRevoke is emitted on Msg/Revoke +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventRevoke { @@ -114,6 +120,7 @@ impl ::prost::Name for EventRevoke { } } /// GenesisState defines the authz module's genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -128,6 +135,7 @@ impl ::prost::Name for GenesisState { } } /// QueryGrantsRequest is the request type for the Query/Grants RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGrantsRequest { @@ -150,6 +158,7 @@ impl ::prost::Name for QueryGrantsRequest { } } /// QueryGrantsResponse is the response type for the Query/Authorizations RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGrantsResponse { @@ -168,6 +177,7 @@ impl ::prost::Name for QueryGrantsResponse { } } /// QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGranterGrantsRequest { @@ -185,6 +195,7 @@ impl ::prost::Name for QueryGranterGrantsRequest { } } /// QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGranterGrantsResponse { @@ -203,6 +214,7 @@ impl ::prost::Name for QueryGranterGrantsResponse { } } /// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGranteeGrantsRequest { @@ -220,6 +232,7 @@ impl ::prost::Name for QueryGranteeGrantsRequest { } } /// QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGranteeGrantsResponse { @@ -239,6 +252,7 @@ impl ::prost::Name for 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgGrant { @@ -257,6 +271,7 @@ impl ::prost::Name for MsgGrant { } } /// MsgExecResponse defines the Msg/MsgExecResponse response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgExecResponse { @@ -273,6 +288,7 @@ impl ::prost::Name for 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgExec { @@ -292,6 +308,7 @@ impl ::prost::Name for MsgExec { } } /// MsgGrantResponse defines the Msg/MsgGrant response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgGrantResponse {} @@ -304,6 +321,7 @@ impl ::prost::Name for MsgGrantResponse { } /// MsgRevoke revokes any authorization with the provided sdk.Msg type on the /// granter's account with that has been granted to the grantee. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRevoke { @@ -322,6 +340,7 @@ impl ::prost::Name for MsgRevoke { } } /// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRevokeResponse {} @@ -1166,6 +1185,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x6e, 0x73, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x0a, 0x0a, 0x0a, 0x0a, 0x03, 0x04, 0x05, 0x01, 0x12, 0x03, 0x50, 0x08, 0x19, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.authz.v1beta1.serde.rs"); include!("cosmos.authz.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.authz.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.authz.v1beta1.serde.rs deleted file mode 100644 index 16dce0f..0000000 --- a/packages/proto/src/gen/cosmos.authz.v1beta1.serde.rs +++ /dev/null @@ -1,2143 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.autocli.v1.rs b/packages/proto/src/gen/cosmos.autocli.v1.rs index 13f7a8c..75c547f 100644 --- a/packages/proto/src/gen/cosmos.autocli.v1.rs +++ b/packages/proto/src/gen/cosmos.autocli.v1.rs @@ -1,5 +1,6 @@ // @generated /// ModuleOptions describes the CLI options for a Cosmos SDK module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleOptions { @@ -18,6 +19,7 @@ impl ::prost::Name for ModuleOptions { } } /// ServiceCommandDescriptor describes a CLI command based on a protobuf service. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ServiceCommandDescriptor { @@ -47,6 +49,7 @@ impl ::prost::Name for ServiceCommandDescriptor { } /// RpcCommandOptions specifies options for commands generated from protobuf /// rpc methods. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RpcCommandOptions { @@ -109,6 +112,7 @@ impl ::prost::Name for RpcCommandOptions { /// By default, all request fields are configured as flags based on the /// kebab-case name of the field. Fields can be turned into positional arguments /// instead by using RpcCommandOptions.positional_args. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FlagOptions { @@ -145,6 +149,7 @@ impl ::prost::Name for FlagOptions { } } /// PositionalArgDescriptor describes a positional argument. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PositionalArgDescriptor { @@ -166,6 +171,7 @@ impl ::prost::Name for PositionalArgDescriptor { } } /// AppOptionsRequest is the RemoteInfoService/AppOptions request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AppOptionsRequest {} @@ -177,6 +183,7 @@ impl ::prost::Name for AppOptionsRequest { } } /// AppOptionsResponse is the RemoteInfoService/AppOptions response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AppOptionsResponse { @@ -701,6 +708,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x04, 0x01, 0x02, 0x00, 0x01, 0x12, 0x03, 0x1a, 0x1d, 0x2b, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x00, 0x03, 0x12, 0x03, 0x1a, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.autocli.v1.serde.rs"); include!("cosmos.autocli.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.autocli.v1.serde.rs b/packages/proto/src/gen/cosmos.autocli.v1.serde.rs deleted file mode 100644 index 9ef1314..0000000 --- a/packages/proto/src/gen/cosmos.autocli.v1.serde.rs +++ /dev/null @@ -1,1054 +0,0 @@ -// @generated -impl serde::Serialize for AppOptionsRequest { - #[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.autocli.v1.AppOptionsRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for AppOptionsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = AppOptionsRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.autocli.v1.AppOptionsRequest") - } - - 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(AppOptionsRequest {}) - } - } - deserializer.deserialize_struct( - "cosmos.autocli.v1.AppOptionsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for AppOptionsResponse { - #[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_options.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.autocli.v1.AppOptionsResponse", len)?; - if !self.module_options.is_empty() { - struct_ser.serialize_field("moduleOptions", &self.module_options)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for AppOptionsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["module_options", "moduleOptions"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ModuleOptions, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "moduleOptions" | "module_options" => Ok(GeneratedField::ModuleOptions), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = AppOptionsResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.autocli.v1.AppOptionsResponse") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut module_options__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ModuleOptions => { - if module_options__.is_some() { - return Err(serde::de::Error::duplicate_field("moduleOptions")); - } - module_options__ = - Some(map.next_value::>()?); - } - } - } - Ok(AppOptionsResponse { - module_options: module_options__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.autocli.v1.AppOptionsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for FlagOptions { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.name.is_empty() { - len += 1; - } - if !self.shorthand.is_empty() { - len += 1; - } - if !self.usage.is_empty() { - len += 1; - } - if !self.default_value.is_empty() { - len += 1; - } - if !self.no_opt_default_value.is_empty() { - len += 1; - } - if !self.deprecated.is_empty() { - len += 1; - } - if !self.shorthand_deprecated.is_empty() { - len += 1; - } - if self.hidden { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.autocli.v1.FlagOptions", len)?; - if !self.name.is_empty() { - struct_ser.serialize_field("name", &self.name)?; - } - if !self.shorthand.is_empty() { - struct_ser.serialize_field("shorthand", &self.shorthand)?; - } - if !self.usage.is_empty() { - struct_ser.serialize_field("usage", &self.usage)?; - } - if !self.default_value.is_empty() { - struct_ser.serialize_field("defaultValue", &self.default_value)?; - } - if !self.no_opt_default_value.is_empty() { - struct_ser.serialize_field("noOptDefaultValue", &self.no_opt_default_value)?; - } - if !self.deprecated.is_empty() { - struct_ser.serialize_field("deprecated", &self.deprecated)?; - } - if !self.shorthand_deprecated.is_empty() { - struct_ser.serialize_field("shorthandDeprecated", &self.shorthand_deprecated)?; - } - if self.hidden { - struct_ser.serialize_field("hidden", &self.hidden)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for FlagOptions { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "name", - "shorthand", - "usage", - "default_value", - "defaultValue", - "no_opt_default_value", - "noOptDefaultValue", - "deprecated", - "shorthand_deprecated", - "shorthandDeprecated", - "hidden", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Name, - Shorthand, - Usage, - DefaultValue, - NoOptDefaultValue, - Deprecated, - ShorthandDeprecated, - Hidden, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "shorthand" => Ok(GeneratedField::Shorthand), - "usage" => Ok(GeneratedField::Usage), - "defaultValue" | "default_value" => Ok(GeneratedField::DefaultValue), - "noOptDefaultValue" | "no_opt_default_value" => { - Ok(GeneratedField::NoOptDefaultValue) - } - "deprecated" => Ok(GeneratedField::Deprecated), - "shorthandDeprecated" | "shorthand_deprecated" => { - Ok(GeneratedField::ShorthandDeprecated) - } - "hidden" => Ok(GeneratedField::Hidden), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = FlagOptions; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.autocli.v1.FlagOptions") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut name__ = None; - let mut shorthand__ = None; - let mut usage__ = None; - let mut default_value__ = None; - let mut no_opt_default_value__ = None; - let mut deprecated__ = None; - let mut shorthand_deprecated__ = None; - let mut hidden__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map.next_value()?); - } - GeneratedField::Shorthand => { - if shorthand__.is_some() { - return Err(serde::de::Error::duplicate_field("shorthand")); - } - shorthand__ = Some(map.next_value()?); - } - GeneratedField::Usage => { - if usage__.is_some() { - return Err(serde::de::Error::duplicate_field("usage")); - } - usage__ = Some(map.next_value()?); - } - GeneratedField::DefaultValue => { - if default_value__.is_some() { - return Err(serde::de::Error::duplicate_field("defaultValue")); - } - default_value__ = Some(map.next_value()?); - } - GeneratedField::NoOptDefaultValue => { - if no_opt_default_value__.is_some() { - return Err(serde::de::Error::duplicate_field("noOptDefaultValue")); - } - no_opt_default_value__ = Some(map.next_value()?); - } - GeneratedField::Deprecated => { - if deprecated__.is_some() { - return Err(serde::de::Error::duplicate_field("deprecated")); - } - deprecated__ = Some(map.next_value()?); - } - GeneratedField::ShorthandDeprecated => { - if shorthand_deprecated__.is_some() { - return Err(serde::de::Error::duplicate_field( - "shorthandDeprecated", - )); - } - shorthand_deprecated__ = Some(map.next_value()?); - } - GeneratedField::Hidden => { - if hidden__.is_some() { - return Err(serde::de::Error::duplicate_field("hidden")); - } - hidden__ = Some(map.next_value()?); - } - } - } - Ok(FlagOptions { - name: name__.unwrap_or_default(), - shorthand: shorthand__.unwrap_or_default(), - usage: usage__.unwrap_or_default(), - default_value: default_value__.unwrap_or_default(), - no_opt_default_value: no_opt_default_value__.unwrap_or_default(), - deprecated: deprecated__.unwrap_or_default(), - shorthand_deprecated: shorthand_deprecated__.unwrap_or_default(), - hidden: hidden__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.autocli.v1.FlagOptions", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ModuleOptions { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.tx.is_some() { - len += 1; - } - if self.query.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.autocli.v1.ModuleOptions", len)?; - if let Some(v) = self.tx.as_ref() { - struct_ser.serialize_field("tx", v)?; - } - if let Some(v) = self.query.as_ref() { - struct_ser.serialize_field("query", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ModuleOptions { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["tx", "query"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Tx, - Query, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "query" => Ok(GeneratedField::Query), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ModuleOptions; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.autocli.v1.ModuleOptions") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut tx__ = None; - let mut query__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Tx => { - if tx__.is_some() { - return Err(serde::de::Error::duplicate_field("tx")); - } - tx__ = map.next_value()?; - } - GeneratedField::Query => { - if query__.is_some() { - return Err(serde::de::Error::duplicate_field("query")); - } - query__ = map.next_value()?; - } - } - } - Ok(ModuleOptions { - tx: tx__, - query: query__, - }) - } - } - deserializer.deserialize_struct("cosmos.autocli.v1.ModuleOptions", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for PositionalArgDescriptor { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.proto_field.is_empty() { - len += 1; - } - if self.varargs { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.autocli.v1.PositionalArgDescriptor", len)?; - if !self.proto_field.is_empty() { - struct_ser.serialize_field("protoField", &self.proto_field)?; - } - if self.varargs { - struct_ser.serialize_field("varargs", &self.varargs)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PositionalArgDescriptor { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["proto_field", "protoField", "varargs"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ProtoField, - Varargs, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "protoField" | "proto_field" => Ok(GeneratedField::ProtoField), - "varargs" => Ok(GeneratedField::Varargs), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PositionalArgDescriptor; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.autocli.v1.PositionalArgDescriptor") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proto_field__ = None; - let mut varargs__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ProtoField => { - if proto_field__.is_some() { - return Err(serde::de::Error::duplicate_field("protoField")); - } - proto_field__ = Some(map.next_value()?); - } - GeneratedField::Varargs => { - if varargs__.is_some() { - return Err(serde::de::Error::duplicate_field("varargs")); - } - varargs__ = Some(map.next_value()?); - } - } - } - Ok(PositionalArgDescriptor { - proto_field: proto_field__.unwrap_or_default(), - varargs: varargs__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.autocli.v1.PositionalArgDescriptor", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for RpcCommandOptions { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.rpc_method.is_empty() { - len += 1; - } - if !self.r#use.is_empty() { - len += 1; - } - if !self.long.is_empty() { - len += 1; - } - if !self.short.is_empty() { - len += 1; - } - if !self.example.is_empty() { - len += 1; - } - if !self.alias.is_empty() { - len += 1; - } - if !self.suggest_for.is_empty() { - len += 1; - } - if !self.deprecated.is_empty() { - len += 1; - } - if !self.version.is_empty() { - len += 1; - } - if !self.flag_options.is_empty() { - len += 1; - } - if !self.positional_args.is_empty() { - len += 1; - } - if self.skip { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.autocli.v1.RpcCommandOptions", len)?; - if !self.rpc_method.is_empty() { - struct_ser.serialize_field("rpcMethod", &self.rpc_method)?; - } - if !self.r#use.is_empty() { - struct_ser.serialize_field("use", &self.r#use)?; - } - if !self.long.is_empty() { - struct_ser.serialize_field("long", &self.long)?; - } - if !self.short.is_empty() { - struct_ser.serialize_field("short", &self.short)?; - } - if !self.example.is_empty() { - struct_ser.serialize_field("example", &self.example)?; - } - if !self.alias.is_empty() { - struct_ser.serialize_field("alias", &self.alias)?; - } - if !self.suggest_for.is_empty() { - struct_ser.serialize_field("suggestFor", &self.suggest_for)?; - } - if !self.deprecated.is_empty() { - struct_ser.serialize_field("deprecated", &self.deprecated)?; - } - if !self.version.is_empty() { - struct_ser.serialize_field("version", &self.version)?; - } - if !self.flag_options.is_empty() { - struct_ser.serialize_field("flagOptions", &self.flag_options)?; - } - if !self.positional_args.is_empty() { - struct_ser.serialize_field("positionalArgs", &self.positional_args)?; - } - if self.skip { - struct_ser.serialize_field("skip", &self.skip)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for RpcCommandOptions { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "rpc_method", - "rpcMethod", - "use", - "long", - "short", - "example", - "alias", - "suggest_for", - "suggestFor", - "deprecated", - "version", - "flag_options", - "flagOptions", - "positional_args", - "positionalArgs", - "skip", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - RpcMethod, - Use, - Long, - Short, - Example, - Alias, - SuggestFor, - Deprecated, - Version, - FlagOptions, - PositionalArgs, - Skip, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "rpcMethod" | "rpc_method" => Ok(GeneratedField::RpcMethod), - "use" => Ok(GeneratedField::Use), - "long" => Ok(GeneratedField::Long), - "short" => Ok(GeneratedField::Short), - "example" => Ok(GeneratedField::Example), - "alias" => Ok(GeneratedField::Alias), - "suggestFor" | "suggest_for" => Ok(GeneratedField::SuggestFor), - "deprecated" => Ok(GeneratedField::Deprecated), - "version" => Ok(GeneratedField::Version), - "flagOptions" | "flag_options" => Ok(GeneratedField::FlagOptions), - "positionalArgs" | "positional_args" => { - Ok(GeneratedField::PositionalArgs) - } - "skip" => Ok(GeneratedField::Skip), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RpcCommandOptions; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.autocli.v1.RpcCommandOptions") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut rpc_method__ = None; - let mut r#use__ = None; - let mut long__ = None; - let mut short__ = None; - let mut example__ = None; - let mut alias__ = None; - let mut suggest_for__ = None; - let mut deprecated__ = None; - let mut version__ = None; - let mut flag_options__ = None; - let mut positional_args__ = None; - let mut skip__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::RpcMethod => { - if rpc_method__.is_some() { - return Err(serde::de::Error::duplicate_field("rpcMethod")); - } - rpc_method__ = Some(map.next_value()?); - } - GeneratedField::Use => { - if r#use__.is_some() { - return Err(serde::de::Error::duplicate_field("use")); - } - r#use__ = Some(map.next_value()?); - } - GeneratedField::Long => { - if long__.is_some() { - return Err(serde::de::Error::duplicate_field("long")); - } - long__ = Some(map.next_value()?); - } - GeneratedField::Short => { - if short__.is_some() { - return Err(serde::de::Error::duplicate_field("short")); - } - short__ = Some(map.next_value()?); - } - GeneratedField::Example => { - if example__.is_some() { - return Err(serde::de::Error::duplicate_field("example")); - } - example__ = Some(map.next_value()?); - } - GeneratedField::Alias => { - if alias__.is_some() { - return Err(serde::de::Error::duplicate_field("alias")); - } - alias__ = Some(map.next_value()?); - } - GeneratedField::SuggestFor => { - if suggest_for__.is_some() { - return Err(serde::de::Error::duplicate_field("suggestFor")); - } - suggest_for__ = Some(map.next_value()?); - } - GeneratedField::Deprecated => { - if deprecated__.is_some() { - return Err(serde::de::Error::duplicate_field("deprecated")); - } - deprecated__ = Some(map.next_value()?); - } - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); - } - version__ = Some(map.next_value()?); - } - GeneratedField::FlagOptions => { - if flag_options__.is_some() { - return Err(serde::de::Error::duplicate_field("flagOptions")); - } - flag_options__ = - Some(map.next_value::>()?); - } - GeneratedField::PositionalArgs => { - if positional_args__.is_some() { - return Err(serde::de::Error::duplicate_field("positionalArgs")); - } - positional_args__ = Some(map.next_value()?); - } - GeneratedField::Skip => { - if skip__.is_some() { - return Err(serde::de::Error::duplicate_field("skip")); - } - skip__ = Some(map.next_value()?); - } - } - } - Ok(RpcCommandOptions { - rpc_method: rpc_method__.unwrap_or_default(), - r#use: r#use__.unwrap_or_default(), - long: long__.unwrap_or_default(), - short: short__.unwrap_or_default(), - example: example__.unwrap_or_default(), - alias: alias__.unwrap_or_default(), - suggest_for: suggest_for__.unwrap_or_default(), - deprecated: deprecated__.unwrap_or_default(), - version: version__.unwrap_or_default(), - flag_options: flag_options__.unwrap_or_default(), - positional_args: positional_args__.unwrap_or_default(), - skip: skip__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.autocli.v1.RpcCommandOptions", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ServiceCommandDescriptor { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.service.is_empty() { - len += 1; - } - if !self.rpc_command_options.is_empty() { - len += 1; - } - if !self.sub_commands.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.autocli.v1.ServiceCommandDescriptor", len)?; - if !self.service.is_empty() { - struct_ser.serialize_field("service", &self.service)?; - } - if !self.rpc_command_options.is_empty() { - struct_ser.serialize_field("rpcCommandOptions", &self.rpc_command_options)?; - } - if !self.sub_commands.is_empty() { - struct_ser.serialize_field("subCommands", &self.sub_commands)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ServiceCommandDescriptor { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "service", - "rpc_command_options", - "rpcCommandOptions", - "sub_commands", - "subCommands", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Service, - RpcCommandOptions, - SubCommands, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "service" => Ok(GeneratedField::Service), - "rpcCommandOptions" | "rpc_command_options" => { - Ok(GeneratedField::RpcCommandOptions) - } - "subCommands" | "sub_commands" => Ok(GeneratedField::SubCommands), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ServiceCommandDescriptor; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.autocli.v1.ServiceCommandDescriptor") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut service__ = None; - let mut rpc_command_options__ = None; - let mut sub_commands__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Service => { - if service__.is_some() { - return Err(serde::de::Error::duplicate_field("service")); - } - service__ = Some(map.next_value()?); - } - GeneratedField::RpcCommandOptions => { - if rpc_command_options__.is_some() { - return Err(serde::de::Error::duplicate_field("rpcCommandOptions")); - } - rpc_command_options__ = Some(map.next_value()?); - } - GeneratedField::SubCommands => { - if sub_commands__.is_some() { - return Err(serde::de::Error::duplicate_field("subCommands")); - } - sub_commands__ = - Some(map.next_value::>()?); - } - } - } - Ok(ServiceCommandDescriptor { - service: service__.unwrap_or_default(), - rpc_command_options: rpc_command_options__.unwrap_or_default(), - sub_commands: sub_commands__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.autocli.v1.ServiceCommandDescriptor", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/cosmos.bank.module.v1.rs b/packages/proto/src/gen/cosmos.bank.module.v1.rs index b0a0c8e..da57216 100644 --- a/packages/proto/src/gen/cosmos.bank.module.v1.rs +++ b/packages/proto/src/gen/cosmos.bank.module.v1.rs @@ -1,5 +1,6 @@ // @generated /// Module is the config object of the bank module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module { @@ -80,5 +81,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x12, 0x03, 0x12, 0x09, 0x12, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x01, 0x03, 0x12, 0x03, 0x12, 0x15, 0x16, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.bank.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.bank.module.v1.serde.rs b/packages/proto/src/gen/cosmos.bank.module.v1.serde.rs deleted file mode 100644 index 5bd551d..0000000 --- a/packages/proto/src/gen/cosmos.bank.module.v1.serde.rs +++ /dev/null @@ -1,122 +0,0 @@ -// @generated -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.blocked_module_accounts_override.is_empty() { - len += 1; - } - if !self.authority.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.bank.module.v1.Module", len)?; - if !self.blocked_module_accounts_override.is_empty() { - struct_ser.serialize_field( - "blockedModuleAccountsOverride", - &self.blocked_module_accounts_override, - )?; - } - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Module { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "blocked_module_accounts_override", - "blockedModuleAccountsOverride", - "authority", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - BlockedModuleAccountsOverride, - Authority, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "blockedModuleAccountsOverride" - | "blocked_module_accounts_override" => { - Ok(GeneratedField::BlockedModuleAccountsOverride) - } - "authority" => Ok(GeneratedField::Authority), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Module; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.bank.module.v1.Module") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut blocked_module_accounts_override__ = None; - let mut authority__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::BlockedModuleAccountsOverride => { - if blocked_module_accounts_override__.is_some() { - return Err(serde::de::Error::duplicate_field( - "blockedModuleAccountsOverride", - )); - } - blocked_module_accounts_override__ = Some(map.next_value()?); - } - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map.next_value()?); - } - } - } - Ok(Module { - blocked_module_accounts_override: blocked_module_accounts_override__ - .unwrap_or_default(), - authority: authority__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.bank.module.v1.Module", FIELDS, GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/cosmos.bank.v1beta1.rs b/packages/proto/src/gen/cosmos.bank.v1beta1.rs index 00eece0..9599963 100644 --- a/packages/proto/src/gen/cosmos.bank.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.bank.v1beta1.rs @@ -3,6 +3,7 @@ /// the granter's account. /// /// Since: cosmos-sdk 0.43 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SendAuthorization { @@ -23,6 +24,7 @@ impl ::prost::Name for SendAuthorization { } } /// Params defines the parameters for the bank module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -46,6 +48,7 @@ impl ::prost::Name for Params { } /// SendEnabled maps coin denom to a send_enabled status (whether a denom is /// sendable). +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SendEnabled { @@ -62,6 +65,7 @@ impl ::prost::Name for SendEnabled { } } /// Input models transaction input. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Input { @@ -78,6 +82,7 @@ impl ::prost::Name for Input { } } /// Output models transaction outputs. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Output { @@ -96,6 +101,7 @@ impl ::prost::Name for Output { /// Supply represents a struct that passively keeps track of the total supply /// amounts in the network. /// This message is deprecated now that supply is indexed by denom. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Supply { @@ -111,6 +117,7 @@ impl ::prost::Name for Supply { } /// DenomUnit represents a struct that describes a given /// denomination unit of the basic token. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DenomUnit { @@ -137,6 +144,7 @@ impl ::prost::Name for DenomUnit { } /// Metadata represents a struct that describes /// a basic token. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Metadata { @@ -183,6 +191,7 @@ impl ::prost::Name for Metadata { } } /// GenesisState defines the bank module's genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -214,6 +223,7 @@ impl ::prost::Name for GenesisState { } /// Balance defines an account address and balance pair used in the bank module's /// genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Balance { @@ -232,6 +242,7 @@ impl ::prost::Name for Balance { } } /// QueryBalanceRequest is the request type for the Query/Balance RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBalanceRequest { @@ -250,6 +261,7 @@ impl ::prost::Name for QueryBalanceRequest { } } /// QueryBalanceResponse is the response type for the Query/Balance RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBalanceResponse { @@ -265,6 +277,7 @@ impl ::prost::Name for QueryBalanceResponse { } } /// QueryBalanceRequest is the request type for the Query/AllBalances RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllBalancesRequest { @@ -284,6 +297,7 @@ impl ::prost::Name for QueryAllBalancesRequest { } /// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllBalancesResponse { @@ -305,6 +319,7 @@ impl ::prost::Name for QueryAllBalancesResponse { /// an account's spendable balances. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalancesRequest { @@ -326,6 +341,7 @@ impl ::prost::Name for QuerySpendableBalancesRequest { /// an account's spendable balances. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalancesResponse { @@ -347,6 +363,7 @@ impl ::prost::Name for QuerySpendableBalancesResponse { /// querying an account's spendable balance for a specific denom. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalanceByDenomRequest { @@ -368,6 +385,7 @@ impl ::prost::Name for QuerySpendableBalanceByDenomRequest { /// querying an account's spendable balance for a specific denom. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalanceByDenomResponse { @@ -384,6 +402,7 @@ impl ::prost::Name for QuerySpendableBalanceByDenomResponse { } /// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalSupplyRequest { @@ -402,6 +421,7 @@ impl ::prost::Name for QueryTotalSupplyRequest { } /// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC /// method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalSupplyResponse { @@ -422,6 +442,7 @@ impl ::prost::Name for QueryTotalSupplyResponse { } } /// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySupplyOfRequest { @@ -437,6 +458,7 @@ impl ::prost::Name for QuerySupplyOfRequest { } } /// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySupplyOfResponse { @@ -452,6 +474,7 @@ impl ::prost::Name for QuerySupplyOfResponse { } } /// QueryParamsRequest defines the request type for querying x/bank parameters. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} @@ -463,6 +486,7 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse defines the response type for querying x/bank parameters. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -477,6 +501,7 @@ impl ::prost::Name for QueryParamsResponse { } } /// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomsMetadataRequest { @@ -493,6 +518,7 @@ impl ::prost::Name for QueryDenomsMetadataRequest { } /// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomsMetadataResponse { @@ -511,6 +537,7 @@ impl ::prost::Name for QueryDenomsMetadataResponse { } } /// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomMetadataRequest { @@ -527,6 +554,7 @@ impl ::prost::Name for QueryDenomMetadataRequest { } /// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomMetadataResponse { @@ -544,6 +572,7 @@ impl ::prost::Name for QueryDenomMetadataResponse { /// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, /// which queries for a paginated set of all account holders of a particular /// denomination. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomOwnersRequest { @@ -566,6 +595,7 @@ impl ::prost::Name for QueryDenomOwnersRequest { /// balance of the denominated token. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DenomOwner { @@ -586,6 +616,7 @@ impl ::prost::Name for DenomOwner { /// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomOwnersResponse { @@ -605,6 +636,7 @@ impl ::prost::Name for QueryDenomOwnersResponse { /// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySendEnabledRequest { @@ -626,6 +658,7 @@ impl ::prost::Name for QuerySendEnabledRequest { /// QuerySendEnabledResponse defines the RPC response of a SendEnable query. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySendEnabledResponse { @@ -644,6 +677,7 @@ impl ::prost::Name for QuerySendEnabledResponse { } } /// MsgSend represents a message to send coins from one account to another. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSend { @@ -662,6 +696,7 @@ impl ::prost::Name for MsgSend { } } /// MsgSendResponse defines the Msg/Send response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSendResponse {} @@ -673,6 +708,7 @@ impl ::prost::Name for MsgSendResponse { } } /// MsgMultiSend represents an arbitrary multi-in, multi-out send message. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgMultiSend { @@ -691,6 +727,7 @@ impl ::prost::Name for MsgMultiSend { } } /// MsgMultiSendResponse defines the Msg/MultiSend response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgMultiSendResponse {} @@ -704,6 +741,7 @@ impl ::prost::Name for MsgMultiSendResponse { /// MsgUpdateParams is the Msg/UpdateParams request type. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -727,6 +765,7 @@ impl ::prost::Name for MsgUpdateParams { /// MsgUpdateParams message. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} @@ -744,6 +783,7 @@ impl ::prost::Name for MsgUpdateParamsResponse { /// message are left unchanged. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetSendEnabled { @@ -769,6 +809,7 @@ impl ::prost::Name for MsgSetSendEnabled { /// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetSendEnabledResponse {} @@ -2758,6 +2799,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x0a, 0x0a, 0x0a, 0x0a, 0x03, 0x04, 0x07, 0x01, 0x12, 0x03, 0x79, 0x08, 0x21, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.bank.v1beta1.serde.rs"); include!("cosmos.bank.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.bank.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.bank.v1beta1.serde.rs deleted file mode 100644 index 5e28f0f..0000000 --- a/packages/proto/src/gen/cosmos.bank.v1beta1.serde.rs +++ /dev/null @@ -1,4530 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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; - } - if !self.send_enabled.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)?; - } - if !self.send_enabled.is_empty() { - struct_ser.serialize_field("sendEnabled", &self.send_enabled)?; - } - struct_ser.end() - } -} -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", - "send_enabled", - "sendEnabled", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - Balances, - Supply, - DenomMetadata, - SendEnabled, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "sendEnabled" | "send_enabled" => Ok(GeneratedField::SendEnabled), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GenesisState; - - fn expecting(&self, formatter: &mut 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; - let mut send_enabled__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Params => { - if params__.is_some() { - return Err(serde::de::Error::duplicate_field("params")); - } - params__ = map.next_value()?; - } - GeneratedField::Balances => { - if balances__.is_some() { - return Err(serde::de::Error::duplicate_field("balances")); - } - balances__ = Some(map.next_value()?); - } - GeneratedField::Supply => { - if supply__.is_some() { - return Err(serde::de::Error::duplicate_field("supply")); - } - supply__ = Some(map.next_value()?); - } - GeneratedField::DenomMetadata => { - if denom_metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("denomMetadata")); - } - denom_metadata__ = Some(map.next_value()?); - } - GeneratedField::SendEnabled => { - if send_enabled__.is_some() { - return Err(serde::de::Error::duplicate_field("sendEnabled")); - } - send_enabled__ = Some(map.next_value()?); - } - } - } - Ok(GenesisState { - params: params__, - balances: balances__.unwrap_or_default(), - supply: supply__.unwrap_or_default(), - denom_metadata: denom_metadata__.unwrap_or_default(), - send_enabled: send_enabled__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.bank.v1beta1.GenesisState", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for Input { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -impl serde::Serialize for MsgSetSendEnabled { - #[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.send_enabled.is_empty() { - len += 1; - } - if !self.use_default_for.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.bank.v1beta1.MsgSetSendEnabled", len)?; - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - if !self.send_enabled.is_empty() { - struct_ser.serialize_field("sendEnabled", &self.send_enabled)?; - } - if !self.use_default_for.is_empty() { - struct_ser.serialize_field("useDefaultFor", &self.use_default_for)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSetSendEnabled { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "authority", - "send_enabled", - "sendEnabled", - "use_default_for", - "useDefaultFor", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authority, - SendEnabled, - UseDefaultFor, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "sendEnabled" | "send_enabled" => Ok(GeneratedField::SendEnabled), - "useDefaultFor" | "use_default_for" => { - Ok(GeneratedField::UseDefaultFor) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSetSendEnabled; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.MsgSetSendEnabled") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authority__ = None; - let mut send_enabled__ = None; - let mut use_default_for__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map.next_value()?); - } - GeneratedField::SendEnabled => { - if send_enabled__.is_some() { - return Err(serde::de::Error::duplicate_field("sendEnabled")); - } - send_enabled__ = Some(map.next_value()?); - } - GeneratedField::UseDefaultFor => { - if use_default_for__.is_some() { - return Err(serde::de::Error::duplicate_field("useDefaultFor")); - } - use_default_for__ = Some(map.next_value()?); - } - } - } - Ok(MsgSetSendEnabled { - authority: authority__.unwrap_or_default(), - send_enabled: send_enabled__.unwrap_or_default(), - use_default_for: use_default_for__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.bank.v1beta1.MsgSetSendEnabled", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgSetSendEnabledResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = - serializer.serialize_struct("cosmos.bank.v1beta1.MsgSetSendEnabledResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSetSendEnabledResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgSetSendEnabledResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.MsgSetSendEnabledResponse") - } - - 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(MsgSetSendEnabledResponse {}) - } - } - deserializer.deserialize_struct( - "cosmos.bank.v1beta1.MsgSetSendEnabledResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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("cosmos.bank.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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 cosmos.bank.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( - "cosmos.bank.v1beta1.MsgUpdateParams", - FIELDS, - GeneratedVisitor, - ) - } -} -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("cosmos.bank.v1beta1.MsgUpdateParamsResponse", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 cosmos.bank.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( - "cosmos.bank.v1beta1.MsgUpdateParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -impl serde::Serialize for QuerySendEnabledRequest { - #[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; - } - if self.pagination.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.bank.v1beta1.QuerySendEnabledRequest", len)?; - if !self.denoms.is_empty() { - struct_ser.serialize_field("denoms", &self.denoms)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QuerySendEnabledRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["denoms", "pagination"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Denoms, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QuerySendEnabledRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QuerySendEnabledRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut denoms__ = None; - let mut pagination__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Denoms => { - if denoms__.is_some() { - return Err(serde::de::Error::duplicate_field("denoms")); - } - denoms__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - } - } - Ok(QuerySendEnabledRequest { - denoms: denoms__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct( - "cosmos.bank.v1beta1.QuerySendEnabledRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QuerySendEnabledResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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.pagination.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.bank.v1beta1.QuerySendEnabledResponse", len)?; - if !self.send_enabled.is_empty() { - struct_ser.serialize_field("sendEnabled", &self.send_enabled)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QuerySendEnabledResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["send_enabled", "sendEnabled", "pagination"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SendEnabled, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QuerySendEnabledResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.bank.v1beta1.QuerySendEnabledResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut send_enabled__ = None; - let mut pagination__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::SendEnabled => { - if send_enabled__.is_some() { - return Err(serde::de::Error::duplicate_field("sendEnabled")); - } - send_enabled__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - } - } - Ok(QuerySendEnabledResponse { - send_enabled: send_enabled__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct( - "cosmos.bank.v1beta1.QuerySendEnabledResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QuerySpendableBalanceByDenomRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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.QuerySpendableBalanceByDenomRequest", - 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() - } -} -impl<'de> serde::Deserialize<'de> for QuerySpendableBalanceByDenomRequest { - #[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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = QuerySpendableBalanceByDenomRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest") - } - - 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(QuerySpendableBalanceByDenomRequest { - address: address__.unwrap_or_default(), - denom: denom__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QuerySpendableBalanceByDenomResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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.QuerySpendableBalanceByDenomResponse", - len, - )?; - if let Some(v) = self.balance.as_ref() { - struct_ser.serialize_field("balance", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QuerySpendableBalanceByDenomResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["balance"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Balance, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = QuerySpendableBalanceByDenomResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse") - } - - 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(QuerySpendableBalanceByDenomResponse { balance: balance__ }) - } - } - deserializer.deserialize_struct( - "cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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; - } - if !self.allow_list.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)?; - } - if !self.allow_list.is_empty() { - struct_ser.serialize_field("allowList", &self.allow_list)?; - } - struct_ser.end() - } -} -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_list", "allowList"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SpendLimit, - AllowList, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "allowList" | "allow_list" => Ok(GeneratedField::AllowList), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SendAuthorization; - - fn expecting(&self, formatter: &mut 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; - let mut allow_list__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::SpendLimit => { - if spend_limit__.is_some() { - return Err(serde::de::Error::duplicate_field("spendLimit")); - } - spend_limit__ = Some(map.next_value()?); - } - GeneratedField::AllowList => { - if allow_list__.is_some() { - return Err(serde::de::Error::duplicate_field("allowList")); - } - allow_list__ = Some(map.next_value()?); - } - } - } - Ok(SendAuthorization { - spend_limit: spend_limit__.unwrap_or_default(), - allow_list: allow_list__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.bank.v1beta1.SendAuthorization", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for SendEnabled { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.base.abci.v1beta1.rs b/packages/proto/src/gen/cosmos.base.abci.v1beta1.rs index e38ba6e..d17bb8f 100644 --- a/packages/proto/src/gen/cosmos.base.abci.v1beta1.rs +++ b/packages/proto/src/gen/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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxResponse { @@ -60,6 +61,7 @@ impl ::prost::Name for TxResponse { } } /// ABCIMessageLog defines a structure containing an indexed tx ABCI message log. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AbciMessageLog { @@ -81,6 +83,7 @@ impl ::prost::Name for AbciMessageLog { } /// StringEvent defines en Event object wrapper where all the attributes /// contain key/value pairs that are strings instead of raw bytes. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StringEvent { @@ -98,6 +101,7 @@ impl ::prost::Name for StringEvent { } /// Attribute defines an attribute wrapper where the key and value are /// strings instead of raw bytes. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Attribute { @@ -114,6 +118,7 @@ impl ::prost::Name for Attribute { } } /// GasInfo defines tx execution gas context. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GasInfo { @@ -132,6 +137,7 @@ impl ::prost::Name for GasInfo { } } /// Result is the union of ResponseFormat and ResponseCheckTx. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Result { @@ -164,6 +170,7 @@ impl ::prost::Name for Result { } /// SimulationResponse defines the response generated when a transaction is /// successfully simulated. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SimulationResponse { @@ -181,6 +188,7 @@ impl ::prost::Name for SimulationResponse { } /// MsgData defines the data returned in a Result object during message /// execution. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgData { @@ -198,6 +206,7 @@ impl ::prost::Name for MsgData { } /// TxMsgData defines a list of MsgData. A transaction will have a MsgData object /// for each message. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxMsgData { @@ -219,6 +228,7 @@ impl ::prost::Name for TxMsgData { } } /// SearchTxsResult defines a structure for querying txs pageable +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SearchTxsResult { @@ -749,5 +759,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x19, 0x0a, 0x0d, 0x0a, 0x05, 0x04, 0x09, 0x02, 0x05, 0x03, 0x12, 0x04, 0x9c, 0x01, 0x1c, 0x1d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.base.abci.v1beta1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.base.abci.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.base.abci.v1beta1.serde.rs deleted file mode 100644 index 78c8a00..0000000 --- a/packages/proto/src/gen/cosmos.base.abci.v1beta1.serde.rs +++ /dev/null @@ -1,1494 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser - .serialize_field("gasWanted", ToString::to_string(&self.gas_wanted).as_str())?; - } - if self.gas_used != 0 { - struct_ser.serialize_field("gasUsed", ToString::to_string(&self.gas_used).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgData { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["msg_type", "msgType", "data"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - MsgType, - Data, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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 { - struct_ser.serialize_field( - "totalCount", - ToString::to_string(&self.total_count).as_str(), - )?; - } - if self.count != 0 { - struct_ser.serialize_field("count", ToString::to_string(&self.count).as_str())?; - } - if self.page_number != 0 { - struct_ser.serialize_field( - "pageNumber", - ToString::to_string(&self.page_number).as_str(), - )?; - } - if self.page_total != 0 { - struct_ser - .serialize_field("pageTotal", ToString::to_string(&self.page_total).as_str())?; - } - if self.limit != 0 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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 { - struct_ser - .serialize_field("gasWanted", ToString::to_string(&self.gas_wanted).as_str())?; - } - if self.gas_used != 0 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.base.kv.v1beta1.rs b/packages/proto/src/gen/cosmos.base.kv.v1beta1.rs index 5527ba7..88c4648 100644 --- a/packages/proto/src/gen/cosmos.base.kv.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.base.kv.v1beta1.rs @@ -1,5 +1,6 @@ // @generated /// Pairs defines a repeated slice of Pair objects. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Pairs { @@ -14,6 +15,7 @@ impl ::prost::Name for Pairs { } } /// Pair defines a key/value bytes tuple. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Pair { @@ -76,5 +78,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x05, 0x04, 0x01, 0x02, 0x01, 0x03, 0x12, 0x03, 0x0f, 0x10, 0x11, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.base.kv.v1beta1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.base.kv.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.base.kv.v1beta1.serde.rs deleted file mode 100644 index 5ed923d..0000000 --- a/packages/proto/src/gen/cosmos.base.kv.v1beta1.serde.rs +++ /dev/null @@ -1,211 +0,0 @@ -// @generated -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() { - struct_ser - .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if !self.value.is_empty() { - struct_ser.serialize_field( - "value", - pbjson::private::base64::encode(&self.value).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Pair { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["key", "value"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Value, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.base.node.v1beta1.rs b/packages/proto/src/gen/cosmos.base.node.v1beta1.rs index 31eba67..a8e59f6 100644 --- a/packages/proto/src/gen/cosmos.base.node.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.base.node.v1beta1.rs @@ -1,5 +1,6 @@ // @generated /// ConfigRequest defines the request structure for the Config gRPC query. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConfigRequest {} @@ -11,6 +12,7 @@ impl ::prost::Name for ConfigRequest { } } /// ConfigResponse defines the response structure for the Config gRPC query. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConfigResponse { @@ -88,6 +90,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x01, 0x02, 0x00, 0x03, 0x12, 0x03, 0x14, 0x1d, 0x1e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.base.node.v1beta1.serde.rs"); include!("cosmos.base.node.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.base.node.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.base.node.v1beta1.serde.rs deleted file mode 100644 index 9488d61..0000000 --- a/packages/proto/src/gen/cosmos.base.node.v1beta1.serde.rs +++ /dev/null @@ -1,176 +0,0 @@ -// @generated -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.base.query.v1beta1.rs b/packages/proto/src/gen/cosmos.base.query.v1beta1.rs index 94b54d0..c5e90a8 100644 --- a/packages/proto/src/gen/cosmos.base.query.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.base.query.v1beta1.rs @@ -6,6 +6,7 @@ /// Foo some_parameter = 1; /// PageRequest pagination = 2; /// } +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PageRequest { @@ -49,6 +50,7 @@ impl ::prost::Name for PageRequest { /// repeated Bar results = 1; /// PageResponse page = 2; /// } +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PageResponse { @@ -217,5 +219,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x01, 0x03, 0x12, 0x03, 0x36, 0x11, 0x12, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.base.query.v1beta1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.base.query.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.base.query.v1beta1.serde.rs deleted file mode 100644 index ff0d027..0000000 --- a/packages/proto/src/gen/cosmos.base.query.v1beta1.serde.rs +++ /dev/null @@ -1,301 +0,0 @@ -// @generated -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() { - struct_ser - .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if self.offset != 0 { - struct_ser.serialize_field("offset", ToString::to_string(&self.offset).as_str())?; - } - if self.limit != 0 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser.serialize_field( - "nextKey", - pbjson::private::base64::encode(&self.next_key).as_str(), - )?; - } - if self.total != 0 { - struct_ser.serialize_field("total", ToString::to_string(&self.total).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.base.reflection.v1beta1.rs b/packages/proto/src/gen/cosmos.base.reflection.v1beta1.rs index a53b7bb..32c3946 100644 --- a/packages/proto/src/gen/cosmos.base.reflection.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.base.reflection.v1beta1.rs @@ -1,5 +1,6 @@ // @generated /// ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListAllInterfacesRequest {} @@ -11,6 +12,7 @@ impl ::prost::Name for ListAllInterfacesRequest { } } /// ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListAllInterfacesResponse { @@ -27,6 +29,7 @@ impl ::prost::Name for ListAllInterfacesResponse { } /// ListImplementationsRequest is the request type of the ListImplementations /// RPC. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListImplementationsRequest { @@ -43,6 +46,7 @@ impl ::prost::Name for ListImplementationsRequest { } /// ListImplementationsResponse is the response type of the ListImplementations /// RPC. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListImplementationsResponse { @@ -195,6 +199,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x01, 0x12, 0x03, 0x2a, 0x12, 0x2e, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x03, 0x02, 0x00, 0x03, 0x12, 0x03, 0x2a, 0x31, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.base.reflection.v1beta1.serde.rs"); include!("cosmos.base.reflection.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.base.reflection.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.base.reflection.v1beta1.serde.rs deleted file mode 100644 index 5883448..0000000 --- a/packages/proto/src/gen/cosmos.base.reflection.v1beta1.serde.rs +++ /dev/null @@ -1,402 +0,0 @@ -// @generated -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.base.reflection.v2alpha1.rs b/packages/proto/src/gen/cosmos.base.reflection.v2alpha1.rs index 608793f..baf7b19 100644 --- a/packages/proto/src/gen/cosmos.base.reflection.v2alpha1.rs +++ b/packages/proto/src/gen/cosmos.base.reflection.v2alpha1.rs @@ -1,5 +1,6 @@ // @generated /// AppDescriptor describes a cosmos-sdk based application +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AppDescriptor { @@ -31,6 +32,7 @@ impl ::prost::Name for AppDescriptor { } } /// TxDescriptor describes the accepted transaction type +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxDescriptor { @@ -52,6 +54,7 @@ impl ::prost::Name for TxDescriptor { } /// AuthnDescriptor provides information on how to sign transactions without relying /// on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AuthnDescriptor { @@ -70,6 +73,7 @@ impl ::prost::Name for 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 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SigningModeDescriptor { @@ -92,6 +96,7 @@ impl ::prost::Name for SigningModeDescriptor { } } /// ChainDescriptor describes chain information of the application +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ChainDescriptor { @@ -107,6 +112,7 @@ impl ::prost::Name for ChainDescriptor { } } /// CodecDescriptor describes the registered interfaces and provides metadata information on the types +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CodecDescriptor { @@ -122,6 +128,7 @@ impl ::prost::Name for CodecDescriptor { } } /// InterfaceDescriptor describes the implementation of an interface +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InterfaceDescriptor { @@ -144,6 +151,7 @@ impl ::prost::Name for InterfaceDescriptor { } } /// InterfaceImplementerDescriptor describes an interface implementer +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InterfaceImplementerDescriptor { @@ -166,6 +174,7 @@ impl ::prost::Name for InterfaceImplementerDescriptor { } /// InterfaceAcceptingMessageDescriptor describes a protobuf message which contains /// an interface represented as a google.protobuf.Any +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InterfaceAcceptingMessageDescriptor { @@ -186,6 +195,7 @@ impl ::prost::Name for InterfaceAcceptingMessageDescriptor { } } /// ConfigurationDescriptor contains metadata information on the sdk.Config +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConfigurationDescriptor { @@ -201,6 +211,7 @@ impl ::prost::Name for ConfigurationDescriptor { } } /// MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDescriptor { @@ -216,6 +227,7 @@ impl ::prost::Name for MsgDescriptor { } } /// GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetAuthnDescriptorRequest {} @@ -227,6 +239,7 @@ impl ::prost::Name for GetAuthnDescriptorRequest { } } /// GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetAuthnDescriptorResponse { @@ -242,6 +255,7 @@ impl ::prost::Name for GetAuthnDescriptorResponse { } } /// GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetChainDescriptorRequest {} @@ -253,6 +267,7 @@ impl ::prost::Name for GetChainDescriptorRequest { } } /// GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetChainDescriptorResponse { @@ -268,6 +283,7 @@ impl ::prost::Name for GetChainDescriptorResponse { } } /// GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetCodecDescriptorRequest {} @@ -279,6 +295,7 @@ impl ::prost::Name for GetCodecDescriptorRequest { } } /// GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetCodecDescriptorResponse { @@ -294,6 +311,7 @@ impl ::prost::Name for GetCodecDescriptorResponse { } } /// GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetConfigurationDescriptorRequest {} @@ -305,6 +323,7 @@ impl ::prost::Name for GetConfigurationDescriptorRequest { } } /// GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetConfigurationDescriptorResponse { @@ -320,6 +339,7 @@ impl ::prost::Name for GetConfigurationDescriptorResponse { } } /// GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetQueryServicesDescriptorRequest {} @@ -331,6 +351,7 @@ impl ::prost::Name for GetQueryServicesDescriptorRequest { } } /// GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetQueryServicesDescriptorResponse { @@ -346,6 +367,7 @@ impl ::prost::Name for GetQueryServicesDescriptorResponse { } } /// GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetTxDescriptorRequest {} @@ -357,6 +379,7 @@ impl ::prost::Name for GetTxDescriptorRequest { } } /// GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetTxDescriptorResponse { @@ -373,6 +396,7 @@ impl ::prost::Name for GetTxDescriptorResponse { } } /// QueryServicesDescriptor contains the list of cosmos-sdk queriable services +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryServicesDescriptor { @@ -388,6 +412,7 @@ impl ::prost::Name for QueryServicesDescriptor { } } /// QueryServiceDescriptor describes a cosmos-sdk queryable service +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryServiceDescriptor { @@ -411,6 +436,7 @@ impl ::prost::Name for 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 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryMethodDescriptor { @@ -1324,6 +1350,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x09, 0x18, 0x0a, 0x0d, 0x0a, 0x05, 0x04, 0x19, 0x02, 0x01, 0x03, 0x12, 0x04, 0xd8, 0x01, 0x1b, 0x1c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.base.reflection.v2alpha1.serde.rs"); include!("cosmos.base.reflection.v2alpha1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.base.reflection.v2alpha1.serde.rs b/packages/proto/src/gen/cosmos.base.reflection.v2alpha1.serde.rs deleted file mode 100644 index 26e0612..0000000 --- a/packages/proto/src/gen/cosmos.base.reflection.v2alpha1.serde.rs +++ /dev/null @@ -1,2797 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.base.snapshots.v1beta1.rs b/packages/proto/src/gen/cosmos.base.snapshots.v1beta1.rs index 13790ca..848a9d2 100644 --- a/packages/proto/src/gen/cosmos.base.snapshots.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.base.snapshots.v1beta1.rs @@ -1,5 +1,6 @@ // @generated /// Snapshot contains Tendermint state sync snapshot info. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Snapshot { @@ -22,6 +23,7 @@ impl ::prost::Name for Snapshot { } } /// Metadata contains SDK-specific snapshot metadata. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Metadata { @@ -39,6 +41,7 @@ impl ::prost::Name for Metadata { /// SnapshotItem is an item contained in a rootmulti.Store snapshot. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotItem { @@ -49,6 +52,7 @@ pub struct SnapshotItem { /// Nested message and enum types in `SnapshotItem`. pub mod snapshot_item { /// item is the specific type of snapshot item. + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Item { @@ -76,6 +80,7 @@ impl ::prost::Name for SnapshotItem { /// SnapshotStoreItem contains metadata about a snapshotted store. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotStoreItem { @@ -92,6 +97,7 @@ impl ::prost::Name for SnapshotStoreItem { /// SnapshotIAVLItem is an exported IAVL node. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotIavlItem { @@ -116,6 +122,7 @@ impl ::prost::Name for SnapshotIavlItem { /// SnapshotExtensionMeta contains metadata about an external snapshotter. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotExtensionMeta { @@ -134,6 +141,7 @@ impl ::prost::Name for SnapshotExtensionMeta { /// SnapshotExtensionPayload contains payloads of an external snapshotter. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotExtensionPayload { @@ -151,6 +159,7 @@ impl ::prost::Name for SnapshotExtensionPayload { /// /// Since: cosmos-sdk 0.46 /// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotKvItem { @@ -170,6 +179,7 @@ impl ::prost::Name for SnapshotKvItem { /// /// Since: cosmos-sdk 0.46 /// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotSchema { @@ -445,5 +455,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x08, 0x02, 0x00, 0x03, 0x12, 0x03, 0x58, 0x18, 0x19, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.base.snapshots.v1beta1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.base.snapshots.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.base.snapshots.v1beta1.serde.rs deleted file mode 100644 index ecc4e5b..0000000 --- a/packages/proto/src/gen/cosmos.base.snapshots.v1beta1.serde.rs +++ /dev/null @@ -1,1177 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() { - struct_ser - .serialize_field("hash", pbjson::private::base64::encode(&self.hash).as_str())?; - } - if let Some(v) = self.metadata.as_ref() { - struct_ser.serialize_field("metadata", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Snapshot { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser.serialize_field( - "payload", - pbjson::private::base64::encode(&self.payload).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SnapshotExtensionPayload { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["payload"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Payload, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser - .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if !self.value.is_empty() { - struct_ser.serialize_field( - "value", - pbjson::private::base64::encode(&self.value).as_str(), - )?; - } - if self.version != 0 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser - .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if !self.value.is_empty() { - struct_ser.serialize_field( - "value", - pbjson::private::base64::encode(&self.value).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SnapshotKvItem { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["key", "value"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Value, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.base.store.v1beta1.rs b/packages/proto/src/gen/cosmos.base.store.v1beta1.rs index 3bbdd8b..ebf758e 100644 --- a/packages/proto/src/gen/cosmos.base.store.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.base.store.v1beta1.rs @@ -1,6 +1,7 @@ // @generated /// CommitInfo defines commit information used by the multi-store when committing /// a version/height. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommitInfo { @@ -20,6 +21,7 @@ impl ::prost::Name for CommitInfo { } /// StoreInfo defines store-specific commit information. It contains a reference /// between a store name and the commit ID. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreInfo { @@ -37,6 +39,7 @@ impl ::prost::Name for StoreInfo { } /// CommitID defines the commitment information when a specific store is /// committed. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommitId { @@ -57,6 +60,7 @@ impl ::prost::Name for CommitId { /// Deletes /// /// Since: cosmos-sdk 0.43 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreKvPair { @@ -80,6 +84,7 @@ impl ::prost::Name for StoreKvPair { } /// BlockMetadata contains all the abci event data of a block /// the file streamer dump them into files together with the state changes. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BlockMetadata { @@ -102,6 +107,7 @@ pub struct BlockMetadata { /// Nested message and enum types in `BlockMetadata`. pub mod block_metadata { /// DeliverTx encapulate deliver tx request and response. + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DeliverTx { @@ -370,5 +376,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x05, 0x04, 0x01, 0x02, 0x05, 0x03, 0x12, 0x03, 0x20, 0x35, 0x36, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.base.store.v1beta1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.base.store.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.base.store.v1beta1.serde.rs deleted file mode 100644 index 674e6c8..0000000 --- a/packages/proto/src/gen/cosmos.base.store.v1beta1.serde.rs +++ /dev/null @@ -1,839 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field("version", ToString::to_string(&self.version).as_str())?; - } - if !self.hash.is_empty() { - struct_ser - .serialize_field("hash", pbjson::private::base64::encode(&self.hash).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CommitId { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["version", "hash"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Version, - Hash, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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; - } - if self.timestamp.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.base.store.v1beta1.CommitInfo", len)?; - if self.version != 0 { - 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)?; - } - if let Some(v) = self.timestamp.as_ref() { - struct_ser.serialize_field("timestamp", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CommitInfo { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["version", "store_infos", "storeInfos", "timestamp"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Version, - StoreInfos, - Timestamp, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "timestamp" => Ok(GeneratedField::Timestamp), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CommitInfo; - - fn expecting(&self, formatter: &mut 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; - let mut timestamp__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); - } - version__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::StoreInfos => { - if store_infos__.is_some() { - return Err(serde::de::Error::duplicate_field("storeInfos")); - } - store_infos__ = Some(map.next_value()?); - } - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); - } - timestamp__ = map.next_value()?; - } - } - } - Ok(CommitInfo { - version: version__.unwrap_or_default(), - store_infos: store_infos__.unwrap_or_default(), - timestamp: timestamp__, - }) - } - } - deserializer.deserialize_struct( - "cosmos.base.store.v1beta1.CommitInfo", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for StoreInfo { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser - .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if !self.value.is_empty() { - struct_ser.serialize_field( - "value", - pbjson::private::base64::encode(&self.value).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for StoreKvPair { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.base.tendermint.v1beta1.rs b/packages/proto/src/gen/cosmos.base.tendermint.v1beta1.rs index 66c5cd7..c83baa1 100644 --- a/packages/proto/src/gen/cosmos.base.tendermint.v1beta1.rs +++ b/packages/proto/src/gen/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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Block { @@ -21,6 +22,7 @@ impl ::prost::Name for Block { } } /// Header defines the structure of a Tendermint block header. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Header { @@ -82,6 +84,7 @@ impl ::prost::Name for Header { } } /// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetValidatorSetByHeightRequest { @@ -99,6 +102,7 @@ impl ::prost::Name for GetValidatorSetByHeightRequest { } } /// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetValidatorSetByHeightResponse { @@ -118,6 +122,7 @@ impl ::prost::Name for GetValidatorSetByHeightResponse { } } /// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestValidatorSetRequest { @@ -133,6 +138,7 @@ impl ::prost::Name for GetLatestValidatorSetRequest { } } /// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestValidatorSetResponse { @@ -152,6 +158,7 @@ impl ::prost::Name for GetLatestValidatorSetResponse { } } /// Validator is the type for the validator-set. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Validator { @@ -172,6 +179,7 @@ impl ::prost::Name for Validator { } } /// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetBlockByHeightRequest { @@ -186,6 +194,7 @@ impl ::prost::Name for GetBlockByHeightRequest { } } /// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetBlockByHeightResponse { @@ -206,6 +215,7 @@ impl ::prost::Name for GetBlockByHeightResponse { } } /// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestBlockRequest {} @@ -217,6 +227,7 @@ impl ::prost::Name for GetLatestBlockRequest { } } /// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestBlockResponse { @@ -237,6 +248,7 @@ impl ::prost::Name for GetLatestBlockResponse { } } /// GetSyncingRequest is the request type for the Query/GetSyncing RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetSyncingRequest {} @@ -248,6 +260,7 @@ impl ::prost::Name for GetSyncingRequest { } } /// GetSyncingResponse is the response type for the Query/GetSyncing RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetSyncingResponse { @@ -262,6 +275,7 @@ impl ::prost::Name for GetSyncingResponse { } } /// GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetNodeInfoRequest {} @@ -273,6 +287,7 @@ impl ::prost::Name for GetNodeInfoRequest { } } /// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetNodeInfoResponse { @@ -289,6 +304,7 @@ impl ::prost::Name for GetNodeInfoResponse { } } /// VersionInfo is the type for the GetNodeInfoResponse message. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct VersionInfo { @@ -318,6 +334,7 @@ impl ::prost::Name for VersionInfo { } } /// Module is the type for VersionInfo +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module { @@ -339,6 +356,7 @@ impl ::prost::Name for Module { } } /// ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AbciQueryRequest { @@ -362,6 +380,7 @@ impl ::prost::Name for AbciQueryRequest { /// /// Note: This type is a duplicate of the ResponseQuery proto type defined in /// Tendermint. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AbciQueryResponse { @@ -398,6 +417,7 @@ impl ::prost::Name for AbciQueryResponse { /// hash. /// /// Note: This type is a duplicate of the ProofOp proto type defined in Tendermint. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProofOp { @@ -418,6 +438,7 @@ impl ::prost::Name for ProofOp { /// ProofOps is Merkle proof defined by the list of ProofOps. /// /// Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProofOps { @@ -1391,6 +1412,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x04, 0x12, 0x02, 0x00, 0x08, 0xf5, 0x8c, 0xa6, 0x05, 0x12, 0x04, 0xce, 0x01, 0x3a, 0x57, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.base.tendermint.v1beta1.serde.rs"); include!("cosmos.base.tendermint.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.base.tendermint.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.base.tendermint.v1beta1.serde.rs deleted file mode 100644 index 794fdd9..0000000 --- a/packages/proto/src/gen/cosmos.base.tendermint.v1beta1.serde.rs +++ /dev/null @@ -1,3037 +0,0 @@ -// @generated -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() { - 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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field("index", ToString::to_string(&self.index).as_str())?; - } - if !self.key.is_empty() { - struct_ser - .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if !self.value.is_empty() { - 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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() { - struct_ser.serialize_field( - "lastCommitHash", - pbjson::private::base64::encode(&self.last_commit_hash).as_str(), - )?; - } - if !self.data_hash.is_empty() { - struct_ser.serialize_field( - "dataHash", - pbjson::private::base64::encode(&self.data_hash).as_str(), - )?; - } - if !self.validators_hash.is_empty() { - struct_ser.serialize_field( - "validatorsHash", - pbjson::private::base64::encode(&self.validators_hash).as_str(), - )?; - } - if !self.next_validators_hash.is_empty() { - struct_ser.serialize_field( - "nextValidatorsHash", - pbjson::private::base64::encode(&self.next_validators_hash).as_str(), - )?; - } - if !self.consensus_hash.is_empty() { - struct_ser.serialize_field( - "consensusHash", - pbjson::private::base64::encode(&self.consensus_hash).as_str(), - )?; - } - if !self.app_hash.is_empty() { - struct_ser.serialize_field( - "appHash", - pbjson::private::base64::encode(&self.app_hash).as_str(), - )?; - } - if !self.last_results_hash.is_empty() { - struct_ser.serialize_field( - "lastResultsHash", - pbjson::private::base64::encode(&self.last_results_hash).as_str(), - )?; - } - if !self.evidence_hash.is_empty() { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser - .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if !self.data.is_empty() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ProofOp { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["type", "key", "data"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Type, - Key, - Data, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field( - "votingPower", - ToString::to_string(&self.voting_power).as_str(), - )?; - } - if self.proposer_priority != 0 { - struct_ser.serialize_field( - "proposerPriority", - ToString::to_string(&self.proposer_priority).as_str(), - )?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.base.v1beta1.rs b/packages/proto/src/gen/cosmos.base.v1beta1.rs index e05ac45..ffa2af8 100644 --- a/packages/proto/src/gen/cosmos.base.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.base.v1beta1.rs @@ -3,6 +3,7 @@ /// /// NOTE: The amount field is an Int which implements the custom method /// signatures required by gogoproto. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Coin { @@ -22,6 +23,7 @@ impl ::prost::Name for Coin { /// /// NOTE: The amount field is an Dec which implements the custom method /// signatures required by gogoproto. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DecCoin { @@ -38,6 +40,7 @@ impl ::prost::Name for DecCoin { } } /// IntProto defines a Protobuf wrapper around an Int object. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IntProto { @@ -52,6 +55,7 @@ impl ::prost::Name for IntProto { } } /// DecProto defines a Protobuf wrapper around a Dec object. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DecProto { @@ -185,5 +189,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x04, 0x03, 0x02, 0x00, 0x08, 0xe9, 0xfb, 0x03, 0x12, 0x03, 0x2e, 0x58, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.base.v1beta1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.base.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.base.v1beta1.serde.rs deleted file mode 100644 index 2767598..0000000 --- a/packages/proto/src/gen/cosmos.base.v1beta1.serde.rs +++ /dev/null @@ -1,401 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.capability.module.v1.rs b/packages/proto/src/gen/cosmos.capability.module.v1.rs index 7a85fe0..d8d1a1e 100644 --- a/packages/proto/src/gen/cosmos.capability.module.v1.rs +++ b/packages/proto/src/gen/cosmos.capability.module.v1.rs @@ -1,5 +1,6 @@ // @generated /// Module is the config object of the capability module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module { @@ -58,5 +59,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x04, 0x00, 0x02, 0x00, 0x01, 0x12, 0x03, 0x0e, 0x07, 0x12, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x00, 0x03, 0x12, 0x03, 0x0e, 0x15, 0x16, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.capability.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.capability.module.v1.serde.rs b/packages/proto/src/gen/cosmos.capability.module.v1.serde.rs deleted file mode 100644 index d21c020..0000000 --- a/packages/proto/src/gen/cosmos.capability.module.v1.serde.rs +++ /dev/null @@ -1,98 +0,0 @@ -// @generated -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.seal_keeper { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.capability.module.v1.Module", len)?; - if self.seal_keeper { - struct_ser.serialize_field("sealKeeper", &self.seal_keeper)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Module { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["seal_keeper", "sealKeeper"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SealKeeper, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "sealKeeper" | "seal_keeper" => Ok(GeneratedField::SealKeeper), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Module; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.capability.module.v1.Module") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut seal_keeper__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::SealKeeper => { - if seal_keeper__.is_some() { - return Err(serde::de::Error::duplicate_field("sealKeeper")); - } - seal_keeper__ = Some(map.next_value()?); - } - } - } - Ok(Module { - seal_keeper: seal_keeper__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.capability.module.v1.Module", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/cosmos.capability.v1beta1.rs b/packages/proto/src/gen/cosmos.capability.v1beta1.rs index dcde00d..234c6d3 100644 --- a/packages/proto/src/gen/cosmos.capability.v1beta1.rs +++ b/packages/proto/src/gen/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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Capability { @@ -16,6 +17,7 @@ impl ::prost::Name for Capability { } /// Owner defines a single capability owner. An owner is defined by the name of /// capability and the module name. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Owner { @@ -33,6 +35,7 @@ impl ::prost::Name for Owner { } /// CapabilityOwners defines a set of owners of a single Capability. The set of /// owners must be unique. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CapabilityOwners { @@ -47,6 +50,7 @@ impl ::prost::Name for CapabilityOwners { } } /// GenesisOwners defines the capability owners with their corresponding index. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisOwners { @@ -65,6 +69,7 @@ impl ::prost::Name for GenesisOwners { } } /// GenesisState defines the capability module's genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -248,5 +253,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x01, 0x02, 0x01, 0x08, 0xf5, 0x8c, 0xa6, 0x05, 0x12, 0x03, 0x19, 0x43, 0x60, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.capability.v1beta1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.capability.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.capability.v1beta1.serde.rs deleted file mode 100644 index 6a3201d..0000000 --- a/packages/proto/src/gen/cosmos.capability.v1beta1.serde.rs +++ /dev/null @@ -1,538 +0,0 @@ -// @generated -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 { - struct_ser.serialize_field("index", ToString::to_string(&self.index).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.consensus.module.v1.rs b/packages/proto/src/gen/cosmos.consensus.module.v1.rs index d88e2e8..2e1ece7 100644 --- a/packages/proto/src/gen/cosmos.consensus.module.v1.rs +++ b/packages/proto/src/gen/cosmos.consensus.module.v1.rs @@ -1,5 +1,6 @@ // @generated /// Module is the config object of the consensus module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module { @@ -52,5 +53,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x00, 0x01, 0x12, 0x03, 0x0d, 0x09, 0x12, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x00, 0x03, 0x12, 0x03, 0x0d, 0x15, 0x16, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.consensus.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.consensus.module.v1.serde.rs b/packages/proto/src/gen/cosmos.consensus.module.v1.serde.rs deleted file mode 100644 index 211227c..0000000 --- a/packages/proto/src/gen/cosmos.consensus.module.v1.serde.rs +++ /dev/null @@ -1,98 +0,0 @@ -// @generated -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.authority.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.consensus.module.v1.Module", len)?; - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Module { - #[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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = Module; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.consensus.module.v1.Module") - } - - 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(Module { - authority: authority__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.consensus.module.v1.Module", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/cosmos.consensus.v1.rs b/packages/proto/src/gen/cosmos.consensus.v1.rs index f6a190b..c6dc9df 100644 --- a/packages/proto/src/gen/cosmos.consensus.v1.rs +++ b/packages/proto/src/gen/cosmos.consensus.v1.rs @@ -1,5 +1,6 @@ // @generated /// QueryParamsRequest defines the request type for querying x/consensus parameters. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} @@ -11,6 +12,7 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse defines the response type for querying x/consensus parameters. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -28,6 +30,7 @@ impl ::prost::Name for QueryParamsResponse { } } /// MsgUpdateParams is the Msg/UpdateParams request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -55,6 +58,7 @@ impl ::prost::Name for MsgUpdateParams { } /// MsgUpdateParamsResponse defines the response structure for executing a /// MsgUpdateParams message. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} @@ -257,6 +261,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x0a, 0x0a, 0x03, 0x04, 0x01, 0x01, 0x12, 0x03, 0x26, 0x08, 0x1f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.consensus.v1.serde.rs"); include!("cosmos.consensus.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.consensus.v1.serde.rs b/packages/proto/src/gen/cosmos.consensus.v1.serde.rs deleted file mode 100644 index d137fa1..0000000 --- a/packages/proto/src/gen/cosmos.consensus.v1.serde.rs +++ /dev/null @@ -1,396 +0,0 @@ -// @generated -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.block.is_some() { - len += 1; - } - if self.evidence.is_some() { - len += 1; - } - if self.validator.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.consensus.v1.MsgUpdateParams", len)?; - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - if let Some(v) = self.block.as_ref() { - struct_ser.serialize_field("block", v)?; - } - if let Some(v) = self.evidence.as_ref() { - struct_ser.serialize_field("evidence", v)?; - } - if let Some(v) = self.validator.as_ref() { - struct_ser.serialize_field("validator", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUpdateParams { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["authority", "block", "evidence", "validator"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authority, - Block, - Evidence, - Validator, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "block" => Ok(GeneratedField::Block), - "evidence" => Ok(GeneratedField::Evidence), - "validator" => Ok(GeneratedField::Validator), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgUpdateParams; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.consensus.v1.MsgUpdateParams") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authority__ = None; - let mut block__ = None; - let mut evidence__ = None; - let mut validator__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map.next_value()?); - } - GeneratedField::Block => { - if block__.is_some() { - return Err(serde::de::Error::duplicate_field("block")); - } - block__ = map.next_value()?; - } - GeneratedField::Evidence => { - if evidence__.is_some() { - return Err(serde::de::Error::duplicate_field("evidence")); - } - evidence__ = map.next_value()?; - } - GeneratedField::Validator => { - if validator__.is_some() { - return Err(serde::de::Error::duplicate_field("validator")); - } - validator__ = map.next_value()?; - } - } - } - Ok(MsgUpdateParams { - authority: authority__.unwrap_or_default(), - block: block__, - evidence: evidence__, - validator: validator__, - }) - } - } - deserializer.deserialize_struct( - "cosmos.consensus.v1.MsgUpdateParams", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgUpdateParamsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = - serializer.serialize_struct("cosmos.consensus.v1.MsgUpdateParamsResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUpdateParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 cosmos.consensus.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( - "cosmos.consensus.v1.MsgUpdateParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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.consensus.v1.QueryParamsRequest", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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.consensus.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( - "cosmos.consensus.v1.QueryParamsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -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.consensus.v1.QueryParamsResponse", len)?; - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["params"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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.consensus.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( - "cosmos.consensus.v1.QueryParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/cosmos.crisis.module.v1.rs b/packages/proto/src/gen/cosmos.crisis.module.v1.rs index e7b35a5..e00fa22 100644 --- a/packages/proto/src/gen/cosmos.crisis.module.v1.rs +++ b/packages/proto/src/gen/cosmos.crisis.module.v1.rs @@ -1,5 +1,6 @@ // @generated /// Module is the config object of the crisis module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module { @@ -65,5 +66,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x01, 0x12, 0x03, 0x10, 0x09, 0x12, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x01, 0x03, 0x12, 0x03, 0x10, 0x15, 0x16, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.crisis.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.crisis.module.v1.serde.rs b/packages/proto/src/gen/cosmos.crisis.module.v1.serde.rs deleted file mode 100644 index 533a489..0000000 --- a/packages/proto/src/gen/cosmos.crisis.module.v1.serde.rs +++ /dev/null @@ -1,111 +0,0 @@ -// @generated -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.fee_collector_name.is_empty() { - len += 1; - } - if !self.authority.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.crisis.module.v1.Module", len)?; - if !self.fee_collector_name.is_empty() { - struct_ser.serialize_field("feeCollectorName", &self.fee_collector_name)?; - } - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Module { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["fee_collector_name", "feeCollectorName", "authority"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - FeeCollectorName, - Authority, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "feeCollectorName" | "fee_collector_name" => { - Ok(GeneratedField::FeeCollectorName) - } - "authority" => Ok(GeneratedField::Authority), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Module; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.crisis.module.v1.Module") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut fee_collector_name__ = None; - let mut authority__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::FeeCollectorName => { - if fee_collector_name__.is_some() { - return Err(serde::de::Error::duplicate_field("feeCollectorName")); - } - fee_collector_name__ = Some(map.next_value()?); - } - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map.next_value()?); - } - } - } - Ok(Module { - fee_collector_name: fee_collector_name__.unwrap_or_default(), - authority: authority__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.crisis.module.v1.Module", FIELDS, GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/cosmos.crisis.v1beta1.rs b/packages/proto/src/gen/cosmos.crisis.v1beta1.rs index 7bbb3d9..7b49b0a 100644 --- a/packages/proto/src/gen/cosmos.crisis.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.crisis.v1beta1.rs @@ -1,5 +1,6 @@ // @generated /// GenesisState defines the crisis module's genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -16,6 +17,7 @@ impl ::prost::Name for GenesisState { } } /// MsgVerifyInvariant represents a message to verify a particular invariance. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVerifyInvariant { @@ -37,6 +39,7 @@ impl ::prost::Name for MsgVerifyInvariant { } } /// MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVerifyInvariantResponse {} @@ -50,6 +53,7 @@ impl ::prost::Name for MsgVerifyInvariantResponse { /// MsgUpdateParams is the Msg/UpdateParams request type. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -71,6 +75,7 @@ impl ::prost::Name for MsgUpdateParams { /// MsgUpdateParams message. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} @@ -302,6 +307,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x0a, 0x03, 0x04, 0x03, 0x01, 0x12, 0x03, 0x40, 0x08, 0x1f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.crisis.v1beta1.serde.rs"); include!("cosmos.crisis.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.crisis.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.crisis.v1beta1.serde.rs deleted file mode 100644 index 3808d31..0000000 --- a/packages/proto/src/gen/cosmos.crisis.v1beta1.serde.rs +++ /dev/null @@ -1,510 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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.constant_fee.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.crisis.v1beta1.MsgUpdateParams", len)?; - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - if let Some(v) = self.constant_fee.as_ref() { - struct_ser.serialize_field("constantFee", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUpdateParams { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["authority", "constant_fee", "constantFee"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authority, - ConstantFee, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "constantFee" | "constant_fee" => Ok(GeneratedField::ConstantFee), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgUpdateParams; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.crisis.v1beta1.MsgUpdateParams") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authority__ = None; - let mut constant_fee__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map.next_value()?); - } - GeneratedField::ConstantFee => { - if constant_fee__.is_some() { - return Err(serde::de::Error::duplicate_field("constantFee")); - } - constant_fee__ = map.next_value()?; - } - } - } - Ok(MsgUpdateParams { - authority: authority__.unwrap_or_default(), - constant_fee: constant_fee__, - }) - } - } - deserializer.deserialize_struct( - "cosmos.crisis.v1beta1.MsgUpdateParams", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgUpdateParamsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = - serializer.serialize_struct("cosmos.crisis.v1beta1.MsgUpdateParamsResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUpdateParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 cosmos.crisis.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( - "cosmos.crisis.v1beta1.MsgUpdateParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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/packages/proto/src/gen/cosmos.crypto.ed25519.rs b/packages/proto/src/gen/cosmos.crypto.ed25519.rs index 07f7df5..132d07d 100644 --- a/packages/proto/src/gen/cosmos.crypto.ed25519.rs +++ b/packages/proto/src/gen/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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PubKey { @@ -19,6 +20,7 @@ impl ::prost::Name for PubKey { } /// Deprecated: PrivKey defines a ed25519 private key. /// NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PrivKey { @@ -136,5 +138,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x04, 0x01, 0x02, 0x00, 0x08, 0xef, 0xfb, 0x03, 0x12, 0x03, 0x25, 0x11, 0x43, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.crypto.ed25519.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.crypto.ed25519.serde.rs b/packages/proto/src/gen/cosmos.crypto.ed25519.serde.rs deleted file mode 100644 index 50f53da..0000000 --- a/packages/proto/src/gen/cosmos.crypto.ed25519.serde.rs +++ /dev/null @@ -1,193 +0,0 @@ -// @generated -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() { - struct_ser - .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PrivKey { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["key"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() { - struct_ser - .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PubKey { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["key"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.crypto.hd.v1.rs b/packages/proto/src/gen/cosmos.crypto.hd.v1.rs index a20e69e..93749d2 100644 --- a/packages/proto/src/gen/cosmos.crypto.hd.v1.rs +++ b/packages/proto/src/gen/cosmos.crypto.hd.v1.rs @@ -1,5 +1,6 @@ // @generated /// BIP44Params is used as path field in ledger item in Record. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Bip44Params { @@ -112,5 +113,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x09, 0x16, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x04, 0x03, 0x12, 0x03, 0x19, 0x19, 0x1a, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.crypto.hd.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.crypto.hd.v1.serde.rs b/packages/proto/src/gen/cosmos.crypto.hd.v1.serde.rs deleted file mode 100644 index 9635005..0000000 --- a/packages/proto/src/gen/cosmos.crypto.hd.v1.serde.rs +++ /dev/null @@ -1,177 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.crypto.keyring.v1.rs b/packages/proto/src/gen/cosmos.crypto.keyring.v1.rs index d4eacff..5a072b0 100644 --- a/packages/proto/src/gen/cosmos.crypto.keyring.v1.rs +++ b/packages/proto/src/gen/cosmos.crypto.keyring.v1.rs @@ -1,5 +1,6 @@ // @generated /// Record is used for representing a key in the keyring. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Record { @@ -17,6 +18,7 @@ pub struct Record { pub mod record { /// Item is a keyring item stored in a keyring backend. /// Local item + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Local { @@ -31,6 +33,7 @@ pub mod record { } } /// Ledger item + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Ledger { @@ -45,6 +48,7 @@ pub mod record { } } /// Multi item + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Multi {} @@ -56,6 +60,7 @@ pub mod record { } } /// Offline item + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Offline {} @@ -67,6 +72,7 @@ pub mod record { } } /// Record contains one of the following items + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Item { @@ -219,5 +225,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x03, 0x03, 0x01, 0x12, 0x03, 0x2e, 0x0a, 0x11, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.crypto.keyring.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.crypto.keyring.v1.serde.rs b/packages/proto/src/gen/cosmos.crypto.keyring.v1.serde.rs deleted file mode 100644 index 8c2bff9..0000000 --- a/packages/proto/src/gen/cosmos.crypto.keyring.v1.serde.rs +++ /dev/null @@ -1,516 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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/packages/proto/src/gen/cosmos.crypto.multisig.rs b/packages/proto/src/gen/cosmos.crypto.multisig.rs index 75097d1..fc1aaa3 100644 --- a/packages/proto/src/gen/cosmos.crypto.multisig.rs +++ b/packages/proto/src/gen/cosmos.crypto.multisig.rs @@ -2,6 +2,7 @@ /// LegacyAminoPubKey specifies a public key type /// which nests multiple public keys and a threshold, /// it uses legacy amino address rules. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LegacyAminoPubKey { @@ -111,5 +112,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x0a, 0x09, 0x04, 0x00, 0x02, 0x01, 0x08, 0xf4, 0x8c, 0xa6, 0x05, 0x12, 0x03, 0x1c, 0x54, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.crypto.multisig.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.crypto.multisig.serde.rs b/packages/proto/src/gen/cosmos.crypto.multisig.serde.rs deleted file mode 100644 index cd75493..0000000 --- a/packages/proto/src/gen/cosmos.crypto.multisig.serde.rs +++ /dev/null @@ -1,117 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.crypto.multisig.v1beta1.rs b/packages/proto/src/gen/cosmos.crypto.multisig.v1beta1.rs index 68ef6a9..383867e 100644 --- a/packages/proto/src/gen/cosmos.crypto.multisig.v1beta1.rs +++ b/packages/proto/src/gen/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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MultiSignature { @@ -19,6 +20,7 @@ impl ::prost::Name for 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CompactBitArray { @@ -107,5 +109,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x01, 0x02, 0x01, 0x03, 0x12, 0x03, 0x17, 0x1d, 0x1e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.crypto.multisig.v1beta1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.crypto.multisig.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.crypto.multisig.v1beta1.serde.rs deleted file mode 100644 index c911050..0000000 --- a/packages/proto/src/gen/cosmos.crypto.multisig.v1beta1.serde.rs +++ /dev/null @@ -1,234 +0,0 @@ -// @generated -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() { - struct_ser.serialize_field( - "elems", - pbjson::private::base64::encode(&self.elems).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CompactBitArray { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.crypto.secp256k1.rs b/packages/proto/src/gen/cosmos.crypto.secp256k1.rs index 62c886b..2766d64 100644 --- a/packages/proto/src/gen/cosmos.crypto.secp256k1.rs +++ b/packages/proto/src/gen/cosmos.crypto.secp256k1.rs @@ -4,6 +4,7 @@ /// 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PubKey { @@ -18,6 +19,7 @@ impl ::prost::Name for PubKey { } } /// PrivKey defines a secp256k1 private key. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PrivKey { @@ -117,5 +119,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x01, 0x02, 0x00, 0x01, 0x12, 0x03, 0x24, 0x08, 0x0b, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x00, 0x03, 0x12, 0x03, 0x24, 0x0e, 0x0f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.crypto.secp256k1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.crypto.secp256k1.serde.rs b/packages/proto/src/gen/cosmos.crypto.secp256k1.serde.rs deleted file mode 100644 index 2cab5fd..0000000 --- a/packages/proto/src/gen/cosmos.crypto.secp256k1.serde.rs +++ /dev/null @@ -1,193 +0,0 @@ -// @generated -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() { - struct_ser - .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PrivKey { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["key"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() { - struct_ser - .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PubKey { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["key"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.crypto.secp256r1.rs b/packages/proto/src/gen/cosmos.crypto.secp256r1.rs index c04dcff..2af0c74 100644 --- a/packages/proto/src/gen/cosmos.crypto.secp256r1.rs +++ b/packages/proto/src/gen/cosmos.crypto.secp256r1.rs @@ -1,5 +1,6 @@ // @generated /// PubKey defines a secp256r1 ECDSA public key. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PubKey { @@ -16,6 +17,7 @@ impl ::prost::Name for PubKey { } } /// PrivKey defines a secp256r1 ECDSA private key. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PrivKey { @@ -94,5 +96,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x03, 0x15, 0x13, 0x37, 0x0a, 0x0f, 0x0a, 0x08, 0x04, 0x01, 0x02, 0x00, 0x08, 0xeb, 0xfb, 0x03, 0x12, 0x03, 0x15, 0x14, 0x36, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.crypto.secp256r1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.crypto.secp256r1.serde.rs b/packages/proto/src/gen/cosmos.crypto.secp256r1.serde.rs deleted file mode 100644 index d909334..0000000 --- a/packages/proto/src/gen/cosmos.crypto.secp256r1.serde.rs +++ /dev/null @@ -1,195 +0,0 @@ -// @generated -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() { - struct_ser.serialize_field( - "secret", - pbjson::private::base64::encode(&self.secret).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PrivKey { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["secret"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Secret, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() { - struct_ser - .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PubKey { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["key"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.distribution.module.v1.rs b/packages/proto/src/gen/cosmos.distribution.module.v1.rs index d4a98d2..4659a4f 100644 --- a/packages/proto/src/gen/cosmos.distribution.module.v1.rs +++ b/packages/proto/src/gen/cosmos.distribution.module.v1.rs @@ -1,5 +1,6 @@ // @generated /// Module is the config object of the distribution module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module { @@ -61,5 +62,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x00, 0x02, 0x01, 0x01, 0x12, 0x03, 0x0f, 0x09, 0x12, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x01, 0x03, 0x12, 0x03, 0x0f, 0x15, 0x16, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.distribution.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.distribution.module.v1.serde.rs b/packages/proto/src/gen/cosmos.distribution.module.v1.serde.rs deleted file mode 100644 index ceeb958..0000000 --- a/packages/proto/src/gen/cosmos.distribution.module.v1.serde.rs +++ /dev/null @@ -1,116 +0,0 @@ -// @generated -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.fee_collector_name.is_empty() { - len += 1; - } - if !self.authority.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.distribution.module.v1.Module", len)?; - if !self.fee_collector_name.is_empty() { - struct_ser.serialize_field("feeCollectorName", &self.fee_collector_name)?; - } - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Module { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["fee_collector_name", "feeCollectorName", "authority"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - FeeCollectorName, - Authority, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "feeCollectorName" | "fee_collector_name" => { - Ok(GeneratedField::FeeCollectorName) - } - "authority" => Ok(GeneratedField::Authority), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Module; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.distribution.module.v1.Module") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut fee_collector_name__ = None; - let mut authority__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::FeeCollectorName => { - if fee_collector_name__.is_some() { - return Err(serde::de::Error::duplicate_field("feeCollectorName")); - } - fee_collector_name__ = Some(map.next_value()?); - } - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map.next_value()?); - } - } - } - Ok(Module { - fee_collector_name: fee_collector_name__.unwrap_or_default(), - authority: authority__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.distribution.module.v1.Module", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/cosmos.distribution.v1beta1.rs b/packages/proto/src/gen/cosmos.distribution.v1beta1.rs index bfb4c2d..416a26f 100644 --- a/packages/proto/src/gen/cosmos.distribution.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.distribution.v1beta1.rs @@ -1,5 +1,6 @@ // @generated /// Params defines the set of params for the distribution module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -37,6 +38,7 @@ impl ::prost::Name for 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 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorHistoricalRewards { @@ -55,6 +57,7 @@ impl ::prost::Name for 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorCurrentRewards { @@ -72,6 +75,7 @@ impl ::prost::Name for ValidatorCurrentRewards { } /// ValidatorAccumulatedCommission represents accumulated commission /// for a validator kept as a running counter, can be withdrawn at any time. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorAccumulatedCommission { @@ -87,6 +91,7 @@ impl ::prost::Name for ValidatorAccumulatedCommission { } /// ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards /// for a validator inexpensive to track, allows simple sanity checks. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorOutstandingRewards { @@ -104,6 +109,7 @@ impl ::prost::Name for 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorSlashEvent { @@ -120,6 +126,7 @@ impl ::prost::Name for ValidatorSlashEvent { } } /// ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorSlashEvents { @@ -134,6 +141,7 @@ impl ::prost::Name for ValidatorSlashEvents { } } /// FeePool is the global fee pool for distribution. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FeePool { @@ -155,6 +163,7 @@ impl ::prost::Name for FeePool { /// longer a need for an explicit CommunityPoolSpendProposal. To spend community /// pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov /// module via a v1 governance proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommunityPoolSpendProposal { @@ -180,6 +189,7 @@ impl ::prost::Name for 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelegatorStartingInfo { @@ -199,6 +209,7 @@ impl ::prost::Name for DelegatorStartingInfo { } /// DelegationDelegatorReward represents the properties /// of a delegator's delegation reward. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelegationDelegatorReward { @@ -216,6 +227,7 @@ impl ::prost::Name for DelegationDelegatorReward { } /// CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal /// with a deposit +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommunityPoolSpendProposalWithDeposit { @@ -240,6 +252,7 @@ impl ::prost::Name for 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelegatorWithdrawInfo { @@ -258,6 +271,7 @@ impl ::prost::Name for DelegatorWithdrawInfo { } } /// ValidatorOutstandingRewardsRecord is used for import/export via genesis json. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorOutstandingRewardsRecord { @@ -277,6 +291,7 @@ impl ::prost::Name for ValidatorOutstandingRewardsRecord { } /// ValidatorAccumulatedCommissionRecord is used for import / export via genesis /// json. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorAccumulatedCommissionRecord { @@ -296,6 +311,7 @@ impl ::prost::Name for ValidatorAccumulatedCommissionRecord { } /// ValidatorHistoricalRewardsRecord is used for import / export via genesis /// json. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorHistoricalRewardsRecord { @@ -317,6 +333,7 @@ impl ::prost::Name for ValidatorHistoricalRewardsRecord { } } /// ValidatorCurrentRewardsRecord is used for import / export via genesis json. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorCurrentRewardsRecord { @@ -335,6 +352,7 @@ impl ::prost::Name for ValidatorCurrentRewardsRecord { } } /// DelegatorStartingInfoRecord used for import / export via genesis json. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelegatorStartingInfoRecord { @@ -356,6 +374,7 @@ impl ::prost::Name for DelegatorStartingInfoRecord { } } /// ValidatorSlashEventRecord is used for import / export via genesis json. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorSlashEventRecord { @@ -380,6 +399,7 @@ impl ::prost::Name for ValidatorSlashEventRecord { } } /// GenesisState defines the distribution module's genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -423,6 +443,7 @@ impl ::prost::Name for GenesisState { } } /// QueryParamsRequest is the request type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} @@ -434,6 +455,7 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse is the response type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -449,6 +471,7 @@ impl ::prost::Name for QueryParamsResponse { } } /// QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorDistributionInfoRequest { @@ -464,6 +487,7 @@ impl ::prost::Name for QueryValidatorDistributionInfoRequest { } } /// QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorDistributionInfoResponse { @@ -486,6 +510,7 @@ impl ::prost::Name for QueryValidatorDistributionInfoResponse { } /// QueryValidatorOutstandingRewardsRequest is the request type for the /// Query/ValidatorOutstandingRewards RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorOutstandingRewardsRequest { @@ -502,6 +527,7 @@ impl ::prost::Name for QueryValidatorOutstandingRewardsRequest { } /// QueryValidatorOutstandingRewardsResponse is the response type for the /// Query/ValidatorOutstandingRewards RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorOutstandingRewardsResponse { @@ -517,6 +543,7 @@ impl ::prost::Name for QueryValidatorOutstandingRewardsResponse { } /// QueryValidatorCommissionRequest is the request type for the /// Query/ValidatorCommission RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorCommissionRequest { @@ -533,6 +560,7 @@ impl ::prost::Name for QueryValidatorCommissionRequest { } /// QueryValidatorCommissionResponse is the response type for the /// Query/ValidatorCommission RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorCommissionResponse { @@ -549,6 +577,7 @@ impl ::prost::Name for QueryValidatorCommissionResponse { } /// QueryValidatorSlashesRequest is the request type for the /// Query/ValidatorSlashes RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorSlashesRequest { @@ -574,6 +603,7 @@ impl ::prost::Name for QueryValidatorSlashesRequest { } /// QueryValidatorSlashesResponse is the response type for the /// Query/ValidatorSlashes RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorSlashesResponse { @@ -593,6 +623,7 @@ impl ::prost::Name for QueryValidatorSlashesResponse { } /// QueryDelegationRewardsRequest is the request type for the /// Query/DelegationRewards RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegationRewardsRequest { @@ -612,6 +643,7 @@ impl ::prost::Name for QueryDelegationRewardsRequest { } /// QueryDelegationRewardsResponse is the response type for the /// Query/DelegationRewards RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegationRewardsResponse { @@ -628,6 +660,7 @@ impl ::prost::Name for QueryDelegationRewardsResponse { } /// QueryDelegationTotalRewardsRequest is the request type for the /// Query/DelegationTotalRewards RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegationTotalRewardsRequest { @@ -644,6 +677,7 @@ impl ::prost::Name for QueryDelegationTotalRewardsRequest { } /// QueryDelegationTotalRewardsResponse is the response type for the /// Query/DelegationTotalRewards RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegationTotalRewardsResponse { @@ -663,6 +697,7 @@ impl ::prost::Name for QueryDelegationTotalRewardsResponse { } /// QueryDelegatorValidatorsRequest is the request type for the /// Query/DelegatorValidators RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorValidatorsRequest { @@ -679,6 +714,7 @@ impl ::prost::Name for QueryDelegatorValidatorsRequest { } /// QueryDelegatorValidatorsResponse is the response type for the /// Query/DelegatorValidators RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorValidatorsResponse { @@ -695,6 +731,7 @@ impl ::prost::Name for QueryDelegatorValidatorsResponse { } /// QueryDelegatorWithdrawAddressRequest is the request type for the /// Query/DelegatorWithdrawAddress RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorWithdrawAddressRequest { @@ -711,6 +748,7 @@ impl ::prost::Name for QueryDelegatorWithdrawAddressRequest { } /// QueryDelegatorWithdrawAddressResponse is the response type for the /// Query/DelegatorWithdrawAddress RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorWithdrawAddressResponse { @@ -727,6 +765,7 @@ impl ::prost::Name for QueryDelegatorWithdrawAddressResponse { } /// QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCommunityPoolRequest {} @@ -739,6 +778,7 @@ impl ::prost::Name for QueryCommunityPoolRequest { } /// QueryCommunityPoolResponse is the response type for the Query/CommunityPool /// RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCommunityPoolResponse { @@ -755,6 +795,7 @@ impl ::prost::Name for QueryCommunityPoolResponse { } /// MsgSetWithdrawAddress sets the withdraw address for /// a delegator (or validator self-delegation). +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetWithdrawAddress { @@ -772,6 +813,7 @@ impl ::prost::Name for MsgSetWithdrawAddress { } /// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response /// type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetWithdrawAddressResponse {} @@ -784,6 +826,7 @@ impl ::prost::Name for MsgSetWithdrawAddressResponse { } /// MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator /// from a single validator. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawDelegatorReward { @@ -801,6 +844,7 @@ impl ::prost::Name for MsgWithdrawDelegatorReward { } /// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward /// response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawDelegatorRewardResponse { @@ -817,6 +861,7 @@ impl ::prost::Name for MsgWithdrawDelegatorRewardResponse { } /// MsgWithdrawValidatorCommission withdraws the full commission to the validator /// address. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawValidatorCommission { @@ -832,6 +877,7 @@ impl ::prost::Name for MsgWithdrawValidatorCommission { } /// MsgWithdrawValidatorCommissionResponse defines the /// Msg/WithdrawValidatorCommission response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawValidatorCommissionResponse { @@ -848,6 +894,7 @@ impl ::prost::Name for MsgWithdrawValidatorCommissionResponse { } /// MsgFundCommunityPool allows an account to directly /// fund the community pool. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgFundCommunityPool { @@ -864,6 +911,7 @@ impl ::prost::Name for MsgFundCommunityPool { } } /// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgFundCommunityPoolResponse {} @@ -877,6 +925,7 @@ impl ::prost::Name for MsgFundCommunityPoolResponse { /// MsgUpdateParams is the Msg/UpdateParams request type. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -900,6 +949,7 @@ impl ::prost::Name for MsgUpdateParams { /// MsgUpdateParams message. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} @@ -915,6 +965,7 @@ impl ::prost::Name for MsgUpdateParamsResponse { /// proposal with the governance module being the executing authority. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCommunityPoolSpend { @@ -937,6 +988,7 @@ impl ::prost::Name for MsgCommunityPoolSpend { /// MsgCommunityPoolSpend message. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCommunityPoolSpendResponse {} @@ -3504,6 +3556,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x73, 0x64, 0x6b, 0x20, 0x30, 0x2e, 0x34, 0x37, 0x0a, 0x0a, 0x0b, 0x0a, 0x03, 0x04, 0x0b, 0x01, 0x12, 0x04, 0xb1, 0x01, 0x08, 0x25, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.distribution.v1beta1.serde.rs"); include!("cosmos.distribution.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.distribution.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.distribution.v1beta1.serde.rs deleted file mode 100644 index 756bacc..0000000 --- a/packages/proto/src/gen/cosmos.distribution.v1beta1.serde.rs +++ /dev/null @@ -1,6217 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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 { - struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -impl serde::Serialize for MsgCommunityPoolSpend { - #[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.recipient.is_empty() { - len += 1; - } - if !self.amount.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("cosmos.distribution.v1beta1.MsgCommunityPoolSpend", len)?; - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - 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() - } -} -impl<'de> serde::Deserialize<'de> for MsgCommunityPoolSpend { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["authority", "recipient", "amount"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authority, - Recipient, - Amount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "recipient" => Ok(GeneratedField::Recipient), - "amount" => Ok(GeneratedField::Amount), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgCommunityPoolSpend; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.distribution.v1beta1.MsgCommunityPoolSpend") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authority__ = None; - let mut recipient__ = None; - let mut amount__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map.next_value()?); - } - GeneratedField::Recipient => { - if recipient__.is_some() { - return Err(serde::de::Error::duplicate_field("recipient")); - } - recipient__ = Some(map.next_value()?); - } - GeneratedField::Amount => { - if amount__.is_some() { - return Err(serde::de::Error::duplicate_field("amount")); - } - amount__ = Some(map.next_value()?); - } - } - } - Ok(MsgCommunityPoolSpend { - authority: authority__.unwrap_or_default(), - recipient: recipient__.unwrap_or_default(), - amount: amount__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.distribution.v1beta1.MsgCommunityPoolSpend", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgCommunityPoolSpendResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct( - "cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse", - len, - )?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgCommunityPoolSpendResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgCommunityPoolSpendResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse") - } - - 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(MsgCommunityPoolSpendResponse {}) - } - } - deserializer.deserialize_struct( - "cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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("cosmos.distribution.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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 cosmos.distribution.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( - "cosmos.distribution.v1beta1.MsgUpdateParams", - FIELDS, - GeneratedVisitor, - ) - } -} -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("cosmos.distribution.v1beta1.MsgUpdateParamsResponse", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 cosmos.distribution.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( - "cosmos.distribution.v1beta1.MsgUpdateParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -impl serde::Serialize for QueryValidatorDistributionInfoRequest { - #[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.QueryValidatorDistributionInfoRequest", - len, - )?; - if !self.validator_address.is_empty() { - struct_ser.serialize_field("validatorAddress", &self.validator_address)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryValidatorDistributionInfoRequest { - #[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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = QueryValidatorDistributionInfoRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str( - "struct cosmos.distribution.v1beta1.QueryValidatorDistributionInfoRequest", - ) - } - - 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(QueryValidatorDistributionInfoRequest { - validator_address: validator_address__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.distribution.v1beta1.QueryValidatorDistributionInfoRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryValidatorDistributionInfoResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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.self_bond_rewards.is_empty() { - len += 1; - } - if !self.commission.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse", - len, - )?; - if !self.operator_address.is_empty() { - struct_ser.serialize_field("operatorAddress", &self.operator_address)?; - } - if !self.self_bond_rewards.is_empty() { - struct_ser.serialize_field("selfBondRewards", &self.self_bond_rewards)?; - } - if !self.commission.is_empty() { - struct_ser.serialize_field("commission", &self.commission)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryValidatorDistributionInfoResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "operator_address", - "operatorAddress", - "self_bond_rewards", - "selfBondRewards", - "commission", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - OperatorAddress, - SelfBondRewards, - Commission, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } - "selfBondRewards" | "self_bond_rewards" => { - Ok(GeneratedField::SelfBondRewards) - } - "commission" => Ok(GeneratedField::Commission), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryValidatorDistributionInfoResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str( - "struct cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse", - ) - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut operator_address__ = None; - let mut self_bond_rewards__ = None; - let mut commission__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::OperatorAddress => { - if operator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("operatorAddress")); - } - operator_address__ = Some(map.next_value()?); - } - GeneratedField::SelfBondRewards => { - if self_bond_rewards__.is_some() { - return Err(serde::de::Error::duplicate_field("selfBondRewards")); - } - self_bond_rewards__ = Some(map.next_value()?); - } - GeneratedField::Commission => { - if commission__.is_some() { - return Err(serde::de::Error::duplicate_field("commission")); - } - commission__ = Some(map.next_value()?); - } - } - } - Ok(QueryValidatorDistributionInfoResponse { - operator_address: operator_address__.unwrap_or_default(), - self_bond_rewards: self_bond_rewards__.unwrap_or_default(), - commission: commission__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryValidatorOutstandingRewardsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field( - "startingHeight", - ToString::to_string(&self.starting_height).as_str(), - )?; - } - if self.ending_height != 0 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field("period", ToString::to_string(&self.period).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; - } - if self.period != 0 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.evidence.module.v1.rs b/packages/proto/src/gen/cosmos.evidence.module.v1.rs index cffb86f..2890db0 100644 --- a/packages/proto/src/gen/cosmos.evidence.module.v1.rs +++ b/packages/proto/src/gen/cosmos.evidence.module.v1.rs @@ -1,5 +1,6 @@ // @generated /// Module is the config object of the evidence module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module {} @@ -37,5 +38,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x07, 0x87, 0xe8, 0xa2, 0x1b, 0x01, 0x12, 0x03, 0x09, 0x04, 0x38, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.evidence.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.evidence.module.v1.serde.rs b/packages/proto/src/gen/cosmos.evidence.module.v1.serde.rs deleted file mode 100644 index 860d520..0000000 --- a/packages/proto/src/gen/cosmos.evidence.module.v1.serde.rs +++ /dev/null @@ -1,76 +0,0 @@ -// @generated -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.evidence.module.v1.Module", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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.evidence.module.v1.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.evidence.module.v1.Module", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/cosmos.evidence.v1beta1.rs b/packages/proto/src/gen/cosmos.evidence.v1beta1.rs index ab28728..bd20a33 100644 --- a/packages/proto/src/gen/cosmos.evidence.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.evidence.v1beta1.rs @@ -1,6 +1,7 @@ // @generated /// Equivocation implements the Evidence interface and defines evidence of double /// signing misbehavior. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Equivocation { @@ -25,6 +26,7 @@ impl ::prost::Name for Equivocation { } } /// GenesisState defines the evidence module's genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -40,6 +42,7 @@ impl ::prost::Name for GenesisState { } } /// QueryEvidenceRequest is the request type for the Query/Evidence RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEvidenceRequest { @@ -62,6 +65,7 @@ impl ::prost::Name for QueryEvidenceRequest { } } /// QueryEvidenceResponse is the response type for the Query/Evidence RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEvidenceResponse { @@ -78,6 +82,7 @@ impl ::prost::Name for QueryEvidenceResponse { } /// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllEvidenceRequest { @@ -94,6 +99,7 @@ impl ::prost::Name for QueryAllEvidenceRequest { } /// QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllEvidenceResponse { @@ -113,6 +119,7 @@ impl ::prost::Name for QueryAllEvidenceResponse { } /// MsgSubmitEvidence represents a message that supports submitting arbitrary /// Evidence of misbehavior such as equivocation or counterfactual signing. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitEvidence { @@ -131,6 +138,7 @@ impl ::prost::Name for MsgSubmitEvidence { } } /// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitEvidenceResponse { @@ -543,6 +551,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x04, 0x01, 0x02, 0x00, 0x01, 0x12, 0x03, 0x28, 0x08, 0x0c, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x00, 0x03, 0x12, 0x03, 0x28, 0x0f, 0x10, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.evidence.v1beta1.serde.rs"); include!("cosmos.evidence.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.evidence.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.evidence.v1beta1.serde.rs deleted file mode 100644 index 8110fd6..0000000 --- a/packages/proto/src/gen/cosmos.evidence.v1beta1.serde.rs +++ /dev/null @@ -1,909 +0,0 @@ -// @generated -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 { - 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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser - .serialize_field("hash", pbjson::private::base64::encode(&self.hash).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSubmitEvidenceResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["hash"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Hash, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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; - } - if !self.hash.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.evidence.v1beta1.QueryEvidenceRequest", len)?; - if !self.evidence_hash.is_empty() { - struct_ser.serialize_field( - "evidenceHash", - pbjson::private::base64::encode(&self.evidence_hash).as_str(), - )?; - } - if !self.hash.is_empty() { - struct_ser.serialize_field("hash", &self.hash)?; - } - struct_ser.end() - } -} -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", "hash"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - EvidenceHash, - Hash, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "hash" => Ok(GeneratedField::Hash), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryEvidenceRequest; - - fn expecting(&self, formatter: &mut 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; - let mut hash__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::EvidenceHash => { - if evidence_hash__.is_some() { - return Err(serde::de::Error::duplicate_field("evidenceHash")); - } - evidence_hash__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Hash => { - if hash__.is_some() { - return Err(serde::de::Error::duplicate_field("hash")); - } - hash__ = Some(map.next_value()?); - } - } - } - Ok(QueryEvidenceRequest { - evidence_hash: evidence_hash__.unwrap_or_default(), - hash: hash__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.evidence.v1beta1.QueryEvidenceRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryEvidenceResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.feegrant.module.v1.rs b/packages/proto/src/gen/cosmos.feegrant.module.v1.rs index 32f83de..1ed8460 100644 --- a/packages/proto/src/gen/cosmos.feegrant.module.v1.rs +++ b/packages/proto/src/gen/cosmos.feegrant.module.v1.rs @@ -1,5 +1,6 @@ // @generated /// Module is the config object of the feegrant module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module {} @@ -37,5 +38,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x07, 0x87, 0xe8, 0xa2, 0x1b, 0x01, 0x12, 0x03, 0x09, 0x04, 0x38, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.feegrant.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.feegrant.module.v1.serde.rs b/packages/proto/src/gen/cosmos.feegrant.module.v1.serde.rs deleted file mode 100644 index 761fd18..0000000 --- a/packages/proto/src/gen/cosmos.feegrant.module.v1.serde.rs +++ /dev/null @@ -1,76 +0,0 @@ -// @generated -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.feegrant.module.v1.Module", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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.feegrant.module.v1.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.feegrant.module.v1.Module", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/cosmos.feegrant.v1beta1.rs b/packages/proto/src/gen/cosmos.feegrant.v1beta1.rs index 4979467..c307466 100644 --- a/packages/proto/src/gen/cosmos.feegrant.v1beta1.rs +++ b/packages/proto/src/gen/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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BasicAllowance { @@ -22,6 +23,7 @@ impl ::prost::Name for BasicAllowance { } /// PeriodicAllowance extends Allowance to allow for both a maximum cap, /// as well as a limit per time period. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PeriodicAllowance { @@ -53,6 +55,7 @@ impl ::prost::Name for PeriodicAllowance { } } /// AllowedMsgAllowance creates allowance only for specified message types. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AllowedMsgAllowance { @@ -71,6 +74,7 @@ impl ::prost::Name for AllowedMsgAllowance { } } /// Grant is stored in the KVStore to record a grant with full context +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Grant { @@ -92,6 +96,7 @@ impl ::prost::Name for Grant { } } /// GenesisState contains a set of fee allowances, persisted from the store +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -106,6 +111,7 @@ impl ::prost::Name for GenesisState { } } /// QueryAllowanceRequest is the request type for the Query/Allowance RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllowanceRequest { @@ -124,6 +130,7 @@ impl ::prost::Name for QueryAllowanceRequest { } } /// QueryAllowanceResponse is the response type for the Query/Allowance RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllowanceResponse { @@ -139,6 +146,7 @@ impl ::prost::Name for QueryAllowanceResponse { } } /// QueryAllowancesRequest is the request type for the Query/Allowances RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllowancesRequest { @@ -156,6 +164,7 @@ impl ::prost::Name for QueryAllowancesRequest { } } /// QueryAllowancesResponse is the response type for the Query/Allowances RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllowancesResponse { @@ -176,6 +185,7 @@ impl ::prost::Name for QueryAllowancesResponse { /// QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllowancesByGranterRequest { @@ -195,6 +205,7 @@ impl ::prost::Name for QueryAllowancesByGranterRequest { /// QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllowancesByGranterResponse { @@ -214,6 +225,7 @@ impl ::prost::Name for QueryAllowancesByGranterResponse { } /// MsgGrantAllowance adds permission for Grantee to spend up to Allowance /// of fees from the account of Granter. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgGrantAllowance { @@ -235,6 +247,7 @@ impl ::prost::Name for MsgGrantAllowance { } } /// MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgGrantAllowanceResponse {} @@ -246,6 +259,7 @@ impl ::prost::Name for MsgGrantAllowanceResponse { } } /// MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRevokeAllowance { @@ -264,6 +278,7 @@ impl ::prost::Name for MsgRevokeAllowance { } } /// MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRevokeAllowanceResponse {} @@ -1078,6 +1093,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x0a, 0x0a, 0x0a, 0x0a, 0x03, 0x04, 0x03, 0x01, 0x12, 0x03, 0x38, 0x08, 0x22, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.feegrant.v1beta1.serde.rs"); include!("cosmos.feegrant.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.feegrant.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.feegrant.v1beta1.serde.rs deleted file mode 100644 index 1d43879..0000000 --- a/packages/proto/src/gen/cosmos.feegrant.v1beta1.serde.rs +++ /dev/null @@ -1,1710 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.genutil.module.v1.rs b/packages/proto/src/gen/cosmos.genutil.module.v1.rs index 0294752..5e7a8b7 100644 --- a/packages/proto/src/gen/cosmos.genutil.module.v1.rs +++ b/packages/proto/src/gen/cosmos.genutil.module.v1.rs @@ -1,5 +1,6 @@ // @generated /// Module is the config object for the genutil module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module {} @@ -36,5 +37,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x1b, 0x12, 0x04, 0x08, 0x02, 0x0a, 0x04, 0x0a, 0x0f, 0x0a, 0x08, 0x04, 0x00, 0x07, 0x87, 0xe8, 0xa2, 0x1b, 0x01, 0x12, 0x03, 0x09, 0x04, 0x37, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.genutil.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.genutil.module.v1.serde.rs b/packages/proto/src/gen/cosmos.genutil.module.v1.serde.rs deleted file mode 100644 index aaa86ac..0000000 --- a/packages/proto/src/gen/cosmos.genutil.module.v1.serde.rs +++ /dev/null @@ -1,72 +0,0 @@ -// @generated -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.genutil.module.v1.Module", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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.genutil.module.v1.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.genutil.module.v1.Module", FIELDS, GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/cosmos.genutil.v1beta1.rs b/packages/proto/src/gen/cosmos.genutil.v1beta1.rs index 128cfbe..bfd264f 100644 --- a/packages/proto/src/gen/cosmos.genutil.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.genutil.v1beta1.rs @@ -1,5 +1,6 @@ // @generated /// GenesisState defines the raw genesis transaction in JSON. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -58,5 +59,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x0a, 0x10, 0x0a, 0x09, 0x04, 0x00, 0x02, 0x00, 0x08, 0xf5, 0x8c, 0xa6, 0x05, 0x12, 0x03, 0x0f, 0x04, 0x21, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.genutil.v1beta1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.genutil.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.genutil.v1beta1.serde.rs deleted file mode 100644 index 4f5f66e..0000000 --- a/packages/proto/src/gen/cosmos.genutil.v1beta1.serde.rs +++ /dev/null @@ -1,110 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.gov.module.v1.rs b/packages/proto/src/gen/cosmos.gov.module.v1.rs index 5e1b968..eeba3b3 100644 --- a/packages/proto/src/gen/cosmos.gov.module.v1.rs +++ b/packages/proto/src/gen/cosmos.gov.module.v1.rs @@ -1,5 +1,6 @@ // @generated /// Module is the config object of the gov module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module { @@ -68,5 +69,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x00, 0x02, 0x01, 0x03, 0x12, 0x03, 0x11, 0x15, 0x16, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.gov.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.gov.module.v1.serde.rs b/packages/proto/src/gen/cosmos.gov.module.v1.serde.rs deleted file mode 100644 index ba1cd3f..0000000 --- a/packages/proto/src/gen/cosmos.gov.module.v1.serde.rs +++ /dev/null @@ -1,117 +0,0 @@ -// @generated -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.max_metadata_len != 0 { - len += 1; - } - if !self.authority.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.module.v1.Module", len)?; - if self.max_metadata_len != 0 { - struct_ser.serialize_field( - "maxMetadataLen", - ToString::to_string(&self.max_metadata_len).as_str(), - )?; - } - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Module { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["max_metadata_len", "maxMetadataLen", "authority"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - MaxMetadataLen, - Authority, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "maxMetadataLen" | "max_metadata_len" => { - Ok(GeneratedField::MaxMetadataLen) - } - "authority" => Ok(GeneratedField::Authority), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Module; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.gov.module.v1.Module") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut max_metadata_len__ = None; - let mut authority__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::MaxMetadataLen => { - if max_metadata_len__.is_some() { - return Err(serde::de::Error::duplicate_field("maxMetadataLen")); - } - max_metadata_len__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map.next_value()?); - } - } - } - Ok(Module { - max_metadata_len: max_metadata_len__.unwrap_or_default(), - authority: authority__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.module.v1.Module", FIELDS, GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/cosmos.gov.v1.rs b/packages/proto/src/gen/cosmos.gov.v1.rs index fdf9c05..d74abf1 100644 --- a/packages/proto/src/gen/cosmos.gov.v1.rs +++ b/packages/proto/src/gen/cosmos.gov.v1.rs @@ -1,5 +1,6 @@ // @generated /// WeightedVoteOption defines a unit of vote for vote split. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WeightedVoteOption { @@ -19,6 +20,7 @@ impl ::prost::Name for WeightedVoteOption { } /// Deposit defines an amount deposited by an account address to an active /// proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Deposit { @@ -40,6 +42,7 @@ impl ::prost::Name for Deposit { } } /// Proposal defines the core field members of a governance proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Proposal { @@ -99,6 +102,7 @@ impl ::prost::Name for Proposal { } } /// TallyResult defines a standard tally for a governance proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TallyResult { @@ -124,6 +128,7 @@ impl ::prost::Name for TallyResult { } /// Vote defines a vote on a governance proposal. /// A Vote consists of a proposal ID, the voter, and the vote option. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Vote { @@ -148,6 +153,7 @@ impl ::prost::Name for Vote { } } /// DepositParams defines the params for deposits on governance proposals. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DepositParams { @@ -167,6 +173,7 @@ impl ::prost::Name for DepositParams { } } /// VotingParams defines the params for voting on governance proposals. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct VotingParams { @@ -182,6 +189,7 @@ impl ::prost::Name for VotingParams { } } /// TallyParams defines the params for tallying votes on governance proposals. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TallyParams { @@ -207,6 +215,7 @@ impl ::prost::Name for TallyParams { /// Params defines the parameters for the x/gov module. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -252,7 +261,19 @@ impl ::prost::Name for Params { } } /// VoteOption enumerates the valid vote options for a given governance proposal. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum VoteOption { /// VOTE_OPTION_UNSPECIFIED defines a no-op vote option. @@ -293,7 +314,19 @@ impl VoteOption { } } /// ProposalStatus enumerates the valid statuses of a proposal. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum ProposalStatus { /// PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. @@ -343,6 +376,7 @@ impl ProposalStatus { } } /// GenesisState defines the gov module's genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -387,6 +421,7 @@ impl ::prost::Name for GenesisState { } } /// QueryProposalRequest is the request type for the Query/Proposal RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalRequest { @@ -402,6 +437,7 @@ impl ::prost::Name for QueryProposalRequest { } } /// QueryProposalResponse is the response type for the Query/Proposal RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalResponse { @@ -417,6 +453,7 @@ impl ::prost::Name for QueryProposalResponse { } } /// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalsRequest { @@ -442,6 +479,7 @@ impl ::prost::Name for QueryProposalsRequest { } /// QueryProposalsResponse is the response type for the Query/Proposals RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalsResponse { @@ -460,6 +498,7 @@ impl ::prost::Name for QueryProposalsResponse { } } /// QueryVoteRequest is the request type for the Query/Vote RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVoteRequest { @@ -478,6 +517,7 @@ impl ::prost::Name for QueryVoteRequest { } } /// QueryVoteResponse is the response type for the Query/Vote RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVoteResponse { @@ -493,6 +533,7 @@ impl ::prost::Name for QueryVoteResponse { } } /// QueryVotesRequest is the request type for the Query/Votes RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVotesRequest { @@ -511,6 +552,7 @@ impl ::prost::Name for QueryVotesRequest { } } /// QueryVotesResponse is the response type for the Query/Votes RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVotesResponse { @@ -529,6 +571,7 @@ impl ::prost::Name for QueryVotesResponse { } } /// QueryParamsRequest is the request type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest { @@ -545,6 +588,7 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse is the response type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -577,6 +621,7 @@ impl ::prost::Name for QueryParamsResponse { } } /// QueryDepositRequest is the request type for the Query/Deposit RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositRequest { @@ -595,6 +640,7 @@ impl ::prost::Name for QueryDepositRequest { } } /// QueryDepositResponse is the response type for the Query/Deposit RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositResponse { @@ -610,6 +656,7 @@ impl ::prost::Name for QueryDepositResponse { } } /// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositsRequest { @@ -628,6 +675,7 @@ impl ::prost::Name for QueryDepositsRequest { } } /// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositsResponse { @@ -646,6 +694,7 @@ impl ::prost::Name for QueryDepositsResponse { } } /// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTallyResultRequest { @@ -661,6 +710,7 @@ impl ::prost::Name for QueryTallyResultRequest { } } /// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTallyResultResponse { @@ -677,6 +727,7 @@ impl ::prost::Name for QueryTallyResultResponse { } /// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary /// proposal Content. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitProposal { @@ -711,6 +762,7 @@ impl ::prost::Name for MsgSubmitProposal { } } /// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitProposalResponse { @@ -727,6 +779,7 @@ impl ::prost::Name for MsgSubmitProposalResponse { } /// MsgExecLegacyContent is used to wrap the legacy content field into a message. /// This ensures backwards compatibility with v1beta1.MsgSubmitProposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgExecLegacyContent { @@ -745,6 +798,7 @@ impl ::prost::Name for MsgExecLegacyContent { } } /// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgExecLegacyContentResponse {} @@ -756,6 +810,7 @@ impl ::prost::Name for MsgExecLegacyContentResponse { } } /// MsgVote defines a message to cast a vote. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVote { @@ -780,6 +835,7 @@ impl ::prost::Name for MsgVote { } } /// MsgVoteResponse defines the Msg/Vote response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteResponse {} @@ -791,6 +847,7 @@ impl ::prost::Name for MsgVoteResponse { } } /// MsgVoteWeighted defines a message to cast a vote. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteWeighted { @@ -815,6 +872,7 @@ impl ::prost::Name for MsgVoteWeighted { } } /// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteWeightedResponse {} @@ -826,6 +884,7 @@ impl ::prost::Name for MsgVoteWeightedResponse { } } /// MsgDeposit defines a message to submit a deposit to an existing proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDeposit { @@ -847,6 +906,7 @@ impl ::prost::Name for MsgDeposit { } } /// MsgDepositResponse defines the Msg/Deposit response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDepositResponse {} @@ -860,6 +920,7 @@ impl ::prost::Name for MsgDepositResponse { /// MsgUpdateParams is the Msg/UpdateParams request type. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -883,6 +944,7 @@ impl ::prost::Name for MsgUpdateParams { /// MsgUpdateParams message. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} @@ -2907,6 +2969,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x2e, 0x34, 0x37, 0x0a, 0x0a, 0x0b, 0x0a, 0x03, 0x04, 0x0b, 0x01, 0x12, 0x04, 0xab, 0x01, 0x08, 0x1f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.gov.v1.serde.rs"); include!("cosmos.gov.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.gov.v1.serde.rs b/packages/proto/src/gen/cosmos.gov.v1.serde.rs deleted file mode 100644 index 323facb..0000000 --- a/packages/proto/src/gen/cosmos.gov.v1.serde.rs +++ /dev/null @@ -1,4988 +0,0 @@ -// @generated -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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; - } - if self.params.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.GenesisState", len)?; - if self.starting_proposal_id != 0 { - 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)?; - } - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GenesisState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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", - "params", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - StartingProposalId, - Deposits, - Votes, - Proposals, - DepositParams, - VotingParams, - TallyParams, - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "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.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; - let mut params__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::StartingProposalId => { - if starting_proposal_id__.is_some() { - return Err(serde::de::Error::duplicate_field( - "startingProposalId", - )); - } - starting_proposal_id__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Deposits => { - if deposits__.is_some() { - return Err(serde::de::Error::duplicate_field("deposits")); - } - deposits__ = Some(map.next_value()?); - } - GeneratedField::Votes => { - if votes__.is_some() { - return Err(serde::de::Error::duplicate_field("votes")); - } - votes__ = Some(map.next_value()?); - } - GeneratedField::Proposals => { - if proposals__.is_some() { - return Err(serde::de::Error::duplicate_field("proposals")); - } - proposals__ = Some(map.next_value()?); - } - GeneratedField::DepositParams => { - if deposit_params__.is_some() { - return Err(serde::de::Error::duplicate_field("depositParams")); - } - deposit_params__ = map.next_value()?; - } - GeneratedField::VotingParams => { - if voting_params__.is_some() { - return Err(serde::de::Error::duplicate_field("votingParams")); - } - voting_params__ = map.next_value()?; - } - GeneratedField::TallyParams => { - if tally_params__.is_some() { - return Err(serde::de::Error::duplicate_field("tallyParams")); - } - tally_params__ = map.next_value()?; - } - GeneratedField::Params => { - if params__.is_some() { - return Err(serde::de::Error::duplicate_field("params")); - } - params__ = map.next_value()?; - } - } - } - Ok(GenesisState { - starting_proposal_id: starting_proposal_id__.unwrap_or_default(), - deposits: deposits__.unwrap_or_default(), - votes: votes__.unwrap_or_default(), - proposals: proposals__.unwrap_or_default(), - deposit_params: deposit_params__, - voting_params: voting_params__, - tally_params: tally_params__, - params: params__, - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.GenesisState", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgDeposit { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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; - } - if !self.title.is_empty() { - len += 1; - } - if !self.summary.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)?; - } - if !self.title.is_empty() { - struct_ser.serialize_field("title", &self.title)?; - } - if !self.summary.is_empty() { - struct_ser.serialize_field("summary", &self.summary)?; - } - struct_ser.end() - } -} -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", - "title", - "summary", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Messages, - InitialDeposit, - Proposer, - Metadata, - Title, - Summary, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "title" => Ok(GeneratedField::Title), - "summary" => Ok(GeneratedField::Summary), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSubmitProposal; - - fn expecting(&self, formatter: &mut 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; - let mut title__ = None; - let mut summary__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Messages => { - if messages__.is_some() { - return Err(serde::de::Error::duplicate_field("messages")); - } - messages__ = Some(map.next_value()?); - } - GeneratedField::InitialDeposit => { - if initial_deposit__.is_some() { - return Err(serde::de::Error::duplicate_field("initialDeposit")); - } - initial_deposit__ = Some(map.next_value()?); - } - GeneratedField::Proposer => { - if proposer__.is_some() { - return Err(serde::de::Error::duplicate_field("proposer")); - } - proposer__ = Some(map.next_value()?); - } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); - } - metadata__ = Some(map.next_value()?); - } - GeneratedField::Title => { - if title__.is_some() { - return Err(serde::de::Error::duplicate_field("title")); - } - title__ = Some(map.next_value()?); - } - GeneratedField::Summary => { - if summary__.is_some() { - return Err(serde::de::Error::duplicate_field("summary")); - } - summary__ = Some(map.next_value()?); - } - } - } - Ok(MsgSubmitProposal { - messages: messages__.unwrap_or_default(), - initial_deposit: initial_deposit__.unwrap_or_default(), - proposer: proposer__.unwrap_or_default(), - metadata: metadata__.unwrap_or_default(), - title: title__.unwrap_or_default(), - summary: summary__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.MsgSubmitProposal", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgSubmitProposalResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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 { - struct_ser.serialize_field( - "proposalId", - ToString::to_string(&self.proposal_id).as_str(), - )?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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("cosmos.gov.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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 cosmos.gov.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("cosmos.gov.v1.MsgUpdateParams", FIELDS, GeneratedVisitor) - } -} -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("cosmos.gov.v1.MsgUpdateParamsResponse", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 cosmos.gov.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( - "cosmos.gov.v1.MsgUpdateParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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 { - 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::from_i32(self.option).ok_or_else(|| { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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.min_deposit.is_empty() { - len += 1; - } - if self.max_deposit_period.is_some() { - len += 1; - } - if self.voting_period.is_some() { - len += 1; - } - if !self.quorum.is_empty() { - len += 1; - } - if !self.threshold.is_empty() { - len += 1; - } - if !self.veto_threshold.is_empty() { - len += 1; - } - if !self.min_initial_deposit_ratio.is_empty() { - len += 1; - } - if self.burn_vote_quorum { - len += 1; - } - if self.burn_proposal_deposit_prevote { - len += 1; - } - if self.burn_vote_veto { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.Params", 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)?; - } - if let Some(v) = self.voting_period.as_ref() { - struct_ser.serialize_field("votingPeriod", v)?; - } - 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)?; - } - if !self.min_initial_deposit_ratio.is_empty() { - struct_ser - .serialize_field("minInitialDepositRatio", &self.min_initial_deposit_ratio)?; - } - if self.burn_vote_quorum { - struct_ser.serialize_field("burnVoteQuorum", &self.burn_vote_quorum)?; - } - if self.burn_proposal_deposit_prevote { - struct_ser.serialize_field( - "burnProposalDepositPrevote", - &self.burn_proposal_deposit_prevote, - )?; - } - if self.burn_vote_veto { - struct_ser.serialize_field("burnVoteVeto", &self.burn_vote_veto)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Params { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "min_deposit", - "minDeposit", - "max_deposit_period", - "maxDepositPeriod", - "voting_period", - "votingPeriod", - "quorum", - "threshold", - "veto_threshold", - "vetoThreshold", - "min_initial_deposit_ratio", - "minInitialDepositRatio", - "burn_vote_quorum", - "burnVoteQuorum", - "burn_proposal_deposit_prevote", - "burnProposalDepositPrevote", - "burn_vote_veto", - "burnVoteVeto", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - MinDeposit, - MaxDepositPeriod, - VotingPeriod, - Quorum, - Threshold, - VetoThreshold, - MinInitialDepositRatio, - BurnVoteQuorum, - BurnProposalDepositPrevote, - BurnVoteVeto, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } - "votingPeriod" | "voting_period" => Ok(GeneratedField::VotingPeriod), - "quorum" => Ok(GeneratedField::Quorum), - "threshold" => Ok(GeneratedField::Threshold), - "vetoThreshold" | "veto_threshold" => Ok(GeneratedField::VetoThreshold), - "minInitialDepositRatio" | "min_initial_deposit_ratio" => { - Ok(GeneratedField::MinInitialDepositRatio) - } - "burnVoteQuorum" | "burn_vote_quorum" => { - Ok(GeneratedField::BurnVoteQuorum) - } - "burnProposalDepositPrevote" | "burn_proposal_deposit_prevote" => { - Ok(GeneratedField::BurnProposalDepositPrevote) - } - "burnVoteVeto" | "burn_vote_veto" => Ok(GeneratedField::BurnVoteVeto), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Params; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.gov.v1.Params") - } - - 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; - let mut voting_period__ = None; - let mut quorum__ = None; - let mut threshold__ = None; - let mut veto_threshold__ = None; - let mut min_initial_deposit_ratio__ = None; - let mut burn_vote_quorum__ = None; - let mut burn_proposal_deposit_prevote__ = None; - let mut burn_vote_veto__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::MinDeposit => { - if min_deposit__.is_some() { - return Err(serde::de::Error::duplicate_field("minDeposit")); - } - min_deposit__ = Some(map.next_value()?); - } - GeneratedField::MaxDepositPeriod => { - if max_deposit_period__.is_some() { - return Err(serde::de::Error::duplicate_field("maxDepositPeriod")); - } - max_deposit_period__ = map.next_value()?; - } - GeneratedField::VotingPeriod => { - if voting_period__.is_some() { - return Err(serde::de::Error::duplicate_field("votingPeriod")); - } - voting_period__ = map.next_value()?; - } - GeneratedField::Quorum => { - if quorum__.is_some() { - return Err(serde::de::Error::duplicate_field("quorum")); - } - quorum__ = Some(map.next_value()?); - } - GeneratedField::Threshold => { - if threshold__.is_some() { - return Err(serde::de::Error::duplicate_field("threshold")); - } - threshold__ = Some(map.next_value()?); - } - GeneratedField::VetoThreshold => { - if veto_threshold__.is_some() { - return Err(serde::de::Error::duplicate_field("vetoThreshold")); - } - veto_threshold__ = Some(map.next_value()?); - } - GeneratedField::MinInitialDepositRatio => { - if min_initial_deposit_ratio__.is_some() { - return Err(serde::de::Error::duplicate_field( - "minInitialDepositRatio", - )); - } - min_initial_deposit_ratio__ = Some(map.next_value()?); - } - GeneratedField::BurnVoteQuorum => { - if burn_vote_quorum__.is_some() { - return Err(serde::de::Error::duplicate_field("burnVoteQuorum")); - } - burn_vote_quorum__ = Some(map.next_value()?); - } - GeneratedField::BurnProposalDepositPrevote => { - if burn_proposal_deposit_prevote__.is_some() { - return Err(serde::de::Error::duplicate_field( - "burnProposalDepositPrevote", - )); - } - burn_proposal_deposit_prevote__ = Some(map.next_value()?); - } - GeneratedField::BurnVoteVeto => { - if burn_vote_veto__.is_some() { - return Err(serde::de::Error::duplicate_field("burnVoteVeto")); - } - burn_vote_veto__ = Some(map.next_value()?); - } - } - } - Ok(Params { - min_deposit: min_deposit__.unwrap_or_default(), - max_deposit_period: max_deposit_period__, - voting_period: voting_period__, - quorum: quorum__.unwrap_or_default(), - threshold: threshold__.unwrap_or_default(), - veto_threshold: veto_threshold__.unwrap_or_default(), - min_initial_deposit_ratio: min_initial_deposit_ratio__.unwrap_or_default(), - burn_vote_quorum: burn_vote_quorum__.unwrap_or_default(), - burn_proposal_deposit_prevote: burn_proposal_deposit_prevote__ - .unwrap_or_default(), - burn_vote_veto: burn_vote_veto__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.Params", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Proposal { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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; - } - if !self.title.is_empty() { - len += 1; - } - if !self.summary.is_empty() { - len += 1; - } - if !self.proposer.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.Proposal", len)?; - if self.id != 0 { - 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::from_i32(self.status).ok_or_else(|| { - 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)?; - } - if !self.title.is_empty() { - struct_ser.serialize_field("title", &self.title)?; - } - if !self.summary.is_empty() { - struct_ser.serialize_field("summary", &self.summary)?; - } - if !self.proposer.is_empty() { - struct_ser.serialize_field("proposer", &self.proposer)?; - } - struct_ser.end() - } -} -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", - "title", - "summary", - "proposer", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Id, - Messages, - Status, - FinalTallyResult, - SubmitTime, - DepositEndTime, - TotalDeposit, - VotingStartTime, - VotingEndTime, - Metadata, - Title, - Summary, - Proposer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "title" => Ok(GeneratedField::Title), - "summary" => Ok(GeneratedField::Summary), - "proposer" => Ok(GeneratedField::Proposer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Proposal; - - fn expecting(&self, formatter: &mut 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; - let mut title__ = None; - let mut summary__ = None; - let mut proposer__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Id => { - if id__.is_some() { - return Err(serde::de::Error::duplicate_field("id")); - } - id__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Messages => { - if messages__.is_some() { - return Err(serde::de::Error::duplicate_field("messages")); - } - messages__ = Some(map.next_value()?); - } - GeneratedField::Status => { - if status__.is_some() { - return Err(serde::de::Error::duplicate_field("status")); - } - status__ = Some(map.next_value::()? as i32); - } - GeneratedField::FinalTallyResult => { - if final_tally_result__.is_some() { - return Err(serde::de::Error::duplicate_field("finalTallyResult")); - } - final_tally_result__ = map.next_value()?; - } - GeneratedField::SubmitTime => { - if submit_time__.is_some() { - return Err(serde::de::Error::duplicate_field("submitTime")); - } - submit_time__ = map.next_value()?; - } - GeneratedField::DepositEndTime => { - if deposit_end_time__.is_some() { - return Err(serde::de::Error::duplicate_field("depositEndTime")); - } - deposit_end_time__ = map.next_value()?; - } - GeneratedField::TotalDeposit => { - if total_deposit__.is_some() { - return Err(serde::de::Error::duplicate_field("totalDeposit")); - } - total_deposit__ = Some(map.next_value()?); - } - GeneratedField::VotingStartTime => { - if voting_start_time__.is_some() { - return Err(serde::de::Error::duplicate_field("votingStartTime")); - } - voting_start_time__ = map.next_value()?; - } - GeneratedField::VotingEndTime => { - if voting_end_time__.is_some() { - return Err(serde::de::Error::duplicate_field("votingEndTime")); - } - voting_end_time__ = map.next_value()?; - } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); - } - metadata__ = Some(map.next_value()?); - } - GeneratedField::Title => { - if title__.is_some() { - return Err(serde::de::Error::duplicate_field("title")); - } - title__ = Some(map.next_value()?); - } - GeneratedField::Summary => { - if summary__.is_some() { - return Err(serde::de::Error::duplicate_field("summary")); - } - summary__ = Some(map.next_value()?); - } - GeneratedField::Proposer => { - if proposer__.is_some() { - return Err(serde::de::Error::duplicate_field("proposer")); - } - proposer__ = Some(map.next_value()?); - } - } - } - Ok(Proposal { - id: id__.unwrap_or_default(), - messages: messages__.unwrap_or_default(), - status: status__.unwrap_or_default(), - final_tally_result: final_tally_result__, - submit_time: submit_time__, - deposit_end_time: deposit_end_time__, - total_deposit: total_deposit__.unwrap_or_default(), - voting_start_time: voting_start_time__, - voting_end_time: voting_end_time__, - metadata: metadata__.unwrap_or_default(), - title: title__.unwrap_or_default(), - summary: summary__.unwrap_or_default(), - proposer: proposer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.gov.v1.Proposal", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ProposalStatus { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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) - } -} -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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ProposalStatus::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ProposalStatus::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> 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) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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; - } - if self.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)?; - } - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "voting_params", - "votingParams", - "deposit_params", - "depositParams", - "tally_params", - "tallyParams", - "params", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - VotingParams, - DepositParams, - TallyParams, - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "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.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; - let mut params__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::VotingParams => { - if voting_params__.is_some() { - return Err(serde::de::Error::duplicate_field("votingParams")); - } - voting_params__ = map.next_value()?; - } - GeneratedField::DepositParams => { - if deposit_params__.is_some() { - return Err(serde::de::Error::duplicate_field("depositParams")); - } - deposit_params__ = map.next_value()?; - } - GeneratedField::TallyParams => { - if tally_params__.is_some() { - return Err(serde::de::Error::duplicate_field("tallyParams")); - } - tally_params__ = map.next_value()?; - } - GeneratedField::Params => { - if params__.is_some() { - return Err(serde::de::Error::duplicate_field("params")); - } - params__ = map.next_value()?; - } - } - } - Ok(QueryParamsResponse { - voting_params: voting_params__, - deposit_params: deposit_params__, - tally_params: tally_params__, - params: params__, - }) - } - } - deserializer.deserialize_struct( - "cosmos.gov.v1.QueryParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryProposalRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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 { - struct_ser.serialize_field( - "proposalId", - ToString::to_string(&self.proposal_id).as_str(), - )?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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::from_i32(self.proposal_status).ok_or_else(|| { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field( - "proposalId", - ToString::to_string(&self.proposal_id).as_str(), - )?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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) - } -} -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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(VoteOption::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(VoteOption::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> 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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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::from_i32(self.option).ok_or_else(|| { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.gov.v1beta1.rs b/packages/proto/src/gen/cosmos.gov.v1beta1.rs index 461c17f..1c31d87 100644 --- a/packages/proto/src/gen/cosmos.gov.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.gov.v1beta1.rs @@ -2,6 +2,7 @@ /// WeightedVoteOption defines a unit of vote for vote split. /// /// Since: cosmos-sdk 0.43 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WeightedVoteOption { @@ -21,6 +22,7 @@ impl ::prost::Name for WeightedVoteOption { } /// TextProposal defines a standard text proposal whose changes need to be /// manually updated in case of approval. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TextProposal { @@ -40,6 +42,7 @@ impl ::prost::Name for TextProposal { } /// Deposit defines an amount deposited by an account address to an active /// proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Deposit { @@ -61,6 +64,7 @@ impl ::prost::Name for Deposit { } } /// Proposal defines the core field members of a governance proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Proposal { @@ -102,6 +106,7 @@ impl ::prost::Name for Proposal { } } /// TallyResult defines a standard tally for a governance proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TallyResult { @@ -127,6 +132,7 @@ impl ::prost::Name for TallyResult { } /// Vote defines a vote on a governance proposal. /// A Vote consists of a proposal ID, the voter, and the vote option. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Vote { @@ -156,6 +162,7 @@ impl ::prost::Name for Vote { } } /// DepositParams defines the params for deposits on governance proposals. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DepositParams { @@ -175,6 +182,7 @@ impl ::prost::Name for DepositParams { } } /// VotingParams defines the params for voting on governance proposals. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct VotingParams { @@ -190,6 +198,7 @@ impl ::prost::Name for VotingParams { } } /// TallyParams defines the params for tallying votes on governance proposals. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TallyParams { @@ -213,7 +222,19 @@ impl ::prost::Name for TallyParams { } } /// VoteOption enumerates the valid vote options for a given governance proposal. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum VoteOption { /// VOTE_OPTION_UNSPECIFIED defines a no-op vote option. @@ -254,7 +275,19 @@ impl VoteOption { } } /// ProposalStatus enumerates the valid statuses of a proposal. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum ProposalStatus { /// PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. @@ -304,6 +337,7 @@ impl ProposalStatus { } } /// GenesisState defines the gov module's genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -337,6 +371,7 @@ impl ::prost::Name for GenesisState { } } /// QueryProposalRequest is the request type for the Query/Proposal RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalRequest { @@ -352,6 +387,7 @@ impl ::prost::Name for QueryProposalRequest { } } /// QueryProposalResponse is the response type for the Query/Proposal RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalResponse { @@ -366,6 +402,7 @@ impl ::prost::Name for QueryProposalResponse { } } /// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalsRequest { @@ -391,6 +428,7 @@ impl ::prost::Name for QueryProposalsRequest { } /// QueryProposalsResponse is the response type for the Query/Proposals RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalsResponse { @@ -409,6 +447,7 @@ impl ::prost::Name for QueryProposalsResponse { } } /// QueryVoteRequest is the request type for the Query/Vote RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVoteRequest { @@ -427,6 +466,7 @@ impl ::prost::Name for QueryVoteRequest { } } /// QueryVoteResponse is the response type for the Query/Vote RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVoteResponse { @@ -442,6 +482,7 @@ impl ::prost::Name for QueryVoteResponse { } } /// QueryVotesRequest is the request type for the Query/Votes RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVotesRequest { @@ -460,6 +501,7 @@ impl ::prost::Name for QueryVotesRequest { } } /// QueryVotesResponse is the response type for the Query/Votes RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVotesResponse { @@ -478,6 +520,7 @@ impl ::prost::Name for QueryVotesResponse { } } /// QueryParamsRequest is the request type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest { @@ -494,6 +537,7 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse is the response type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -515,6 +559,7 @@ impl ::prost::Name for QueryParamsResponse { } } /// QueryDepositRequest is the request type for the Query/Deposit RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositRequest { @@ -533,6 +578,7 @@ impl ::prost::Name for QueryDepositRequest { } } /// QueryDepositResponse is the response type for the Query/Deposit RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositResponse { @@ -548,6 +594,7 @@ impl ::prost::Name for QueryDepositResponse { } } /// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositsRequest { @@ -566,6 +613,7 @@ impl ::prost::Name for QueryDepositsRequest { } } /// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositsResponse { @@ -584,6 +632,7 @@ impl ::prost::Name for QueryDepositsResponse { } } /// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTallyResultRequest { @@ -599,6 +648,7 @@ impl ::prost::Name for QueryTallyResultRequest { } } /// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTallyResultResponse { @@ -615,6 +665,7 @@ impl ::prost::Name for QueryTallyResultResponse { } /// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary /// proposal Content. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitProposal { @@ -636,6 +687,7 @@ impl ::prost::Name for MsgSubmitProposal { } } /// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitProposalResponse { @@ -651,6 +703,7 @@ impl ::prost::Name for MsgSubmitProposalResponse { } } /// MsgVote defines a message to cast a vote. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVote { @@ -672,6 +725,7 @@ impl ::prost::Name for MsgVote { } } /// MsgVoteResponse defines the Msg/Vote response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteResponse {} @@ -685,6 +739,7 @@ impl ::prost::Name for MsgVoteResponse { /// MsgVoteWeighted defines a message to cast a vote. /// /// Since: cosmos-sdk 0.43 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteWeighted { @@ -708,6 +763,7 @@ impl ::prost::Name for MsgVoteWeighted { /// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. /// /// Since: cosmos-sdk 0.43 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteWeightedResponse {} @@ -719,6 +775,7 @@ impl ::prost::Name for MsgVoteWeightedResponse { } } /// MsgDeposit defines a message to submit a deposit to an existing proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDeposit { @@ -740,6 +797,7 @@ impl ::prost::Name for MsgDeposit { } } /// MsgDepositResponse defines the Msg/Deposit response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDepositResponse {} @@ -2673,6 +2731,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x79, 0x70, 0x65, 0x2e, 0x0a, 0x0a, 0x0b, 0x0a, 0x03, 0x04, 0x07, 0x01, 0x12, 0x04, 0x89, 0x01, 0x08, 0x1a, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.gov.v1beta1.serde.rs"); include!("cosmos.gov.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.gov.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.gov.v1beta1.serde.rs deleted file mode 100644 index 2122a35..0000000 --- a/packages/proto/src/gen/cosmos.gov.v1beta1.serde.rs +++ /dev/null @@ -1,4304 +0,0 @@ -// @generated -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field( - "proposalId", - ToString::to_string(&self.proposal_id).as_str(), - )?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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::from_i32(self.option).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.option)) - })?; - struct_ser.serialize_field("option", &v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgVote { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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 { - 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::from_i32(self.status).ok_or_else(|| { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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) - } -} -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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ProposalStatus::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ProposalStatus::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> 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) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field( - "proposalId", - ToString::to_string(&self.proposal_id).as_str(), - )?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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::from_i32(self.proposal_status).ok_or_else(|| { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field( - "proposalId", - ToString::to_string(&self.proposal_id).as_str(), - )?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser.serialize_field( - "quorum", - pbjson::private::base64::encode(&self.quorum).as_str(), - )?; - } - if !self.threshold.is_empty() { - struct_ser.serialize_field( - "threshold", - pbjson::private::base64::encode(&self.threshold).as_str(), - )?; - } - if !self.veto_threshold.is_empty() { - struct_ser.serialize_field( - "vetoThreshold", - pbjson::private::base64::encode(&self.veto_threshold).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TallyParams { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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 { - 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::from_i32(self.option).ok_or_else(|| { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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) - } -} -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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(VoteOption::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(VoteOption::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> 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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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::from_i32(self.option).ok_or_else(|| { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.group.module.v1.rs b/packages/proto/src/gen/cosmos.group.module.v1.rs index 820b3f5..10dd221 100644 --- a/packages/proto/src/gen/cosmos.group.module.v1.rs +++ b/packages/proto/src/gen/cosmos.group.module.v1.rs @@ -1,5 +1,6 @@ // @generated /// Module is the config object of the group module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module { @@ -90,5 +91,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x12, 0x03, 0x16, 0x09, 0x19, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x01, 0x03, 0x12, 0x03, 0x16, 0x1c, 0x1d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.group.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.group.module.v1.serde.rs b/packages/proto/src/gen/cosmos.group.module.v1.serde.rs deleted file mode 100644 index dcdddd2..0000000 --- a/packages/proto/src/gen/cosmos.group.module.v1.serde.rs +++ /dev/null @@ -1,126 +0,0 @@ -// @generated -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.max_execution_period.is_some() { - len += 1; - } - if self.max_metadata_len != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.group.module.v1.Module", len)?; - if let Some(v) = self.max_execution_period.as_ref() { - struct_ser.serialize_field("maxExecutionPeriod", v)?; - } - if self.max_metadata_len != 0 { - struct_ser.serialize_field( - "maxMetadataLen", - ToString::to_string(&self.max_metadata_len).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Module { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "max_execution_period", - "maxExecutionPeriod", - "max_metadata_len", - "maxMetadataLen", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - MaxExecutionPeriod, - MaxMetadataLen, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "maxExecutionPeriod" | "max_execution_period" => { - Ok(GeneratedField::MaxExecutionPeriod) - } - "maxMetadataLen" | "max_metadata_len" => { - Ok(GeneratedField::MaxMetadataLen) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Module; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.group.module.v1.Module") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut max_execution_period__ = None; - let mut max_metadata_len__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::MaxExecutionPeriod => { - if max_execution_period__.is_some() { - return Err(serde::de::Error::duplicate_field( - "maxExecutionPeriod", - )); - } - max_execution_period__ = map.next_value()?; - } - GeneratedField::MaxMetadataLen => { - if max_metadata_len__.is_some() { - return Err(serde::de::Error::duplicate_field("maxMetadataLen")); - } - max_metadata_len__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(Module { - max_execution_period: max_execution_period__, - max_metadata_len: max_metadata_len__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.group.module.v1.Module", FIELDS, GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/cosmos.group.v1.rs b/packages/proto/src/gen/cosmos.group.v1.rs index 9af55e2..c164c3f 100644 --- a/packages/proto/src/gen/cosmos.group.v1.rs +++ b/packages/proto/src/gen/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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Member { @@ -27,6 +28,7 @@ impl ::prost::Name for Member { /// 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MemberRequest { @@ -53,6 +55,7 @@ impl ::prost::Name for MemberRequest { /// `threshold`. /// 2. The voting and execution periods of the proposal respect the parameters /// given by `windows`. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ThresholdDecisionPolicy { @@ -77,6 +80,7 @@ impl ::prost::Name for ThresholdDecisionPolicy { /// is greater or equal than the given `percentage`. /// 2. The voting and execution periods of the proposal respect the parameters /// given by `windows`. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PercentageDecisionPolicy { @@ -96,6 +100,7 @@ impl ::prost::Name for PercentageDecisionPolicy { } } /// DecisionPolicyWindows defines the different windows for voting and execution. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DecisionPolicyWindows { @@ -129,6 +134,7 @@ impl ::prost::Name for DecisionPolicyWindows { // /// GroupInfo represents the high-level on-chain information for a group. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GroupInfo { @@ -162,6 +168,7 @@ impl ::prost::Name for GroupInfo { } } /// GroupMember represents the relationship between a group and a member. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GroupMember { @@ -180,6 +187,7 @@ impl ::prost::Name for GroupMember { } } /// GroupPolicyInfo represents the high-level on-chain information for a group policy. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GroupPolicyInfo { @@ -219,6 +227,7 @@ impl ::prost::Name for GroupPolicyInfo { /// 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Proposal { @@ -290,6 +299,7 @@ impl ::prost::Name for Proposal { } } /// TallyResult represents the sum of weighted votes for each vote option. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TallyResult { @@ -314,6 +324,7 @@ impl ::prost::Name for TallyResult { } } /// Vote represents a vote for a proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Vote { @@ -341,7 +352,19 @@ impl ::prost::Name for Vote { } } /// VoteOption enumerates the valid vote options for a given proposal. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum VoteOption { /// VOTE_OPTION_UNSPECIFIED defines an unspecified vote option which will @@ -383,7 +406,19 @@ impl VoteOption { } } /// ProposalStatus defines proposal statuses. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum ProposalStatus { /// An empty value is invalid and not allowed. @@ -432,7 +467,19 @@ impl ProposalStatus { } } /// ProposalExecutorResult defines types of proposal executor results. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum ProposalExecutorResult { /// An empty value is not allowed. @@ -469,6 +516,7 @@ impl ProposalExecutorResult { } } /// EventCreateGroup is an event emitted when a group is created. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventCreateGroup { @@ -484,6 +532,7 @@ impl ::prost::Name for EventCreateGroup { } } /// EventUpdateGroup is an event emitted when a group is updated. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventUpdateGroup { @@ -499,6 +548,7 @@ impl ::prost::Name for EventUpdateGroup { } } /// EventCreateGroupPolicy is an event emitted when a group policy is created. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventCreateGroupPolicy { @@ -514,6 +564,7 @@ impl ::prost::Name for EventCreateGroupPolicy { } } /// EventUpdateGroupPolicy is an event emitted when a group policy is updated. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventUpdateGroupPolicy { @@ -529,6 +580,7 @@ impl ::prost::Name for EventUpdateGroupPolicy { } } /// EventSubmitProposal is an event emitted when a proposal is created. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventSubmitProposal { @@ -544,6 +596,7 @@ impl ::prost::Name for EventSubmitProposal { } } /// EventWithdrawProposal is an event emitted when a proposal is withdrawn. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventWithdrawProposal { @@ -559,6 +612,7 @@ impl ::prost::Name for EventWithdrawProposal { } } /// EventVote is an event emitted when a voter votes on a proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventVote { @@ -574,6 +628,7 @@ impl ::prost::Name for EventVote { } } /// EventExec is an event emitted when a proposal is executed. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventExec { @@ -595,6 +650,7 @@ impl ::prost::Name for EventExec { } } /// EventLeaveGroup is an event emitted when group member leaves the group. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventLeaveGroup { @@ -613,6 +669,7 @@ impl ::prost::Name for EventLeaveGroup { } } /// EventProposalPruned is an event emitted when a proposal is pruned. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventProposalPruned { @@ -634,6 +691,7 @@ impl ::prost::Name for EventProposalPruned { } } /// GenesisState defines the group module's genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -673,6 +731,7 @@ impl ::prost::Name for GenesisState { } } /// QueryGroupInfoRequest is the Query/GroupInfo request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupInfoRequest { @@ -688,6 +747,7 @@ impl ::prost::Name for QueryGroupInfoRequest { } } /// QueryGroupInfoResponse is the Query/GroupInfo response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupInfoResponse { @@ -703,6 +763,7 @@ impl ::prost::Name for QueryGroupInfoResponse { } } /// QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupPolicyInfoRequest { @@ -718,6 +779,7 @@ impl ::prost::Name for QueryGroupPolicyInfoRequest { } } /// QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupPolicyInfoResponse { @@ -733,6 +795,7 @@ impl ::prost::Name for QueryGroupPolicyInfoResponse { } } /// QueryGroupMembersRequest is the Query/GroupMembers request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupMembersRequest { @@ -751,6 +814,7 @@ impl ::prost::Name for QueryGroupMembersRequest { } } /// QueryGroupMembersResponse is the Query/GroupMembersResponse response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupMembersResponse { @@ -769,6 +833,7 @@ impl ::prost::Name for QueryGroupMembersResponse { } } /// QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupsByAdminRequest { @@ -787,6 +852,7 @@ impl ::prost::Name for QueryGroupsByAdminRequest { } } /// QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupsByAdminResponse { @@ -805,6 +871,7 @@ impl ::prost::Name for QueryGroupsByAdminResponse { } } /// QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupPoliciesByGroupRequest { @@ -823,6 +890,7 @@ impl ::prost::Name for QueryGroupPoliciesByGroupRequest { } } /// QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupPoliciesByGroupResponse { @@ -841,6 +909,7 @@ impl ::prost::Name for QueryGroupPoliciesByGroupResponse { } } /// QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupPoliciesByAdminRequest { @@ -859,6 +928,7 @@ impl ::prost::Name for QueryGroupPoliciesByAdminRequest { } } /// QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupPoliciesByAdminResponse { @@ -877,6 +947,7 @@ impl ::prost::Name for QueryGroupPoliciesByAdminResponse { } } /// QueryProposalRequest is the Query/Proposal request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalRequest { @@ -892,6 +963,7 @@ impl ::prost::Name for QueryProposalRequest { } } /// QueryProposalResponse is the Query/Proposal response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalResponse { @@ -907,6 +979,7 @@ impl ::prost::Name for QueryProposalResponse { } } /// QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalsByGroupPolicyRequest { @@ -925,6 +998,7 @@ impl ::prost::Name for QueryProposalsByGroupPolicyRequest { } } /// QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalsByGroupPolicyResponse { @@ -943,6 +1017,7 @@ impl ::prost::Name for QueryProposalsByGroupPolicyResponse { } } /// QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVoteByProposalVoterRequest { @@ -961,6 +1036,7 @@ impl ::prost::Name for QueryVoteByProposalVoterRequest { } } /// QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVoteByProposalVoterResponse { @@ -976,6 +1052,7 @@ impl ::prost::Name for QueryVoteByProposalVoterResponse { } } /// QueryVotesByProposalRequest is the Query/VotesByProposal request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVotesByProposalRequest { @@ -994,6 +1071,7 @@ impl ::prost::Name for QueryVotesByProposalRequest { } } /// QueryVotesByProposalResponse is the Query/VotesByProposal response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVotesByProposalResponse { @@ -1012,6 +1090,7 @@ impl ::prost::Name for QueryVotesByProposalResponse { } } /// QueryVotesByVoterRequest is the Query/VotesByVoter request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVotesByVoterRequest { @@ -1030,6 +1109,7 @@ impl ::prost::Name for QueryVotesByVoterRequest { } } /// QueryVotesByVoterResponse is the Query/VotesByVoter response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVotesByVoterResponse { @@ -1048,6 +1128,7 @@ impl ::prost::Name for QueryVotesByVoterResponse { } } /// QueryGroupsByMemberRequest is the Query/GroupsByMember request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupsByMemberRequest { @@ -1066,6 +1147,7 @@ impl ::prost::Name for QueryGroupsByMemberRequest { } } /// QueryGroupsByMemberResponse is the Query/GroupsByMember response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupsByMemberResponse { @@ -1084,6 +1166,7 @@ impl ::prost::Name for QueryGroupsByMemberResponse { } } /// QueryTallyResultRequest is the Query/TallyResult request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTallyResultRequest { @@ -1099,6 +1182,7 @@ impl ::prost::Name for QueryTallyResultRequest { } } /// QueryTallyResultResponse is the Query/TallyResult response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTallyResultResponse { @@ -1116,6 +1200,7 @@ impl ::prost::Name for QueryTallyResultResponse { /// QueryGroupsRequest is the Query/Groups request type. /// /// Since: cosmos-sdk 0.47.1 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupsRequest { @@ -1133,6 +1218,7 @@ impl ::prost::Name for QueryGroupsRequest { /// QueryGroupsResponse is the Query/Groups response type. /// /// Since: cosmos-sdk 0.47.1 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupsResponse { @@ -1155,6 +1241,7 @@ impl ::prost::Name for QueryGroupsResponse { // /// MsgCreateGroup is the Msg/CreateGroup request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateGroup { @@ -1176,6 +1263,7 @@ impl ::prost::Name for MsgCreateGroup { } } /// MsgCreateGroupResponse is the Msg/CreateGroup response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateGroupResponse { @@ -1191,6 +1279,7 @@ impl ::prost::Name for MsgCreateGroupResponse { } } /// MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupMembers { @@ -1213,6 +1302,7 @@ impl ::prost::Name for MsgUpdateGroupMembers { } } /// MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupMembersResponse {} @@ -1224,6 +1314,7 @@ impl ::prost::Name for MsgUpdateGroupMembersResponse { } } /// MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupAdmin { @@ -1245,6 +1336,7 @@ impl ::prost::Name for MsgUpdateGroupAdmin { } } /// MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupAdminResponse {} @@ -1256,6 +1348,7 @@ impl ::prost::Name for MsgUpdateGroupAdminResponse { } } /// MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupMetadata { @@ -1277,6 +1370,7 @@ impl ::prost::Name for MsgUpdateGroupMetadata { } } /// MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupMetadataResponse {} @@ -1292,6 +1386,7 @@ impl ::prost::Name for MsgUpdateGroupMetadataResponse { // /// MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateGroupPolicy { @@ -1316,6 +1411,7 @@ impl ::prost::Name for MsgCreateGroupPolicy { } } /// MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateGroupPolicyResponse { @@ -1331,6 +1427,7 @@ impl ::prost::Name for MsgCreateGroupPolicyResponse { } } /// MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupPolicyAdmin { @@ -1352,6 +1449,7 @@ impl ::prost::Name for MsgUpdateGroupPolicyAdmin { } } /// MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupPolicyAdminResponse {} @@ -1363,6 +1461,7 @@ impl ::prost::Name for MsgUpdateGroupPolicyAdminResponse { } } /// MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateGroupWithPolicy { @@ -1394,6 +1493,7 @@ impl ::prost::Name for MsgCreateGroupWithPolicy { } } /// MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateGroupWithPolicyResponse { @@ -1412,6 +1512,7 @@ impl ::prost::Name for MsgCreateGroupWithPolicyResponse { } } /// MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupPolicyDecisionPolicy { @@ -1433,6 +1534,7 @@ impl ::prost::Name for MsgUpdateGroupPolicyDecisionPolicy { } } /// MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupPolicyDecisionPolicyResponse {} @@ -1444,6 +1546,7 @@ impl ::prost::Name for MsgUpdateGroupPolicyDecisionPolicyResponse { } } /// MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupPolicyMetadata { @@ -1465,6 +1568,7 @@ impl ::prost::Name for MsgUpdateGroupPolicyMetadata { } } /// MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupPolicyMetadataResponse {} @@ -1476,6 +1580,7 @@ impl ::prost::Name for MsgUpdateGroupPolicyMetadataResponse { } } /// MsgSubmitProposal is the Msg/SubmitProposal request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitProposal { @@ -1516,6 +1621,7 @@ impl ::prost::Name for MsgSubmitProposal { } } /// MsgSubmitProposalResponse is the Msg/SubmitProposal response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitProposalResponse { @@ -1531,6 +1637,7 @@ impl ::prost::Name for MsgSubmitProposalResponse { } } /// MsgWithdrawProposal is the Msg/WithdrawProposal request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawProposal { @@ -1549,6 +1656,7 @@ impl ::prost::Name for MsgWithdrawProposal { } } /// MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawProposalResponse {} @@ -1560,6 +1668,7 @@ impl ::prost::Name for MsgWithdrawProposalResponse { } } /// MsgVote is the Msg/Vote request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVote { @@ -1588,6 +1697,7 @@ impl ::prost::Name for MsgVote { } } /// MsgVoteResponse is the Msg/Vote response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteResponse {} @@ -1599,6 +1709,7 @@ impl ::prost::Name for MsgVoteResponse { } } /// MsgExec is the Msg/Exec request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgExec { @@ -1617,6 +1728,7 @@ impl ::prost::Name for MsgExec { } } /// MsgExecResponse is the Msg/Exec request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgExecResponse { @@ -1632,6 +1744,7 @@ impl ::prost::Name for MsgExecResponse { } } /// MsgLeaveGroup is the Msg/LeaveGroup request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgLeaveGroup { @@ -1650,6 +1763,7 @@ impl ::prost::Name for MsgLeaveGroup { } } /// MsgLeaveGroupResponse is the Msg/LeaveGroup response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgLeaveGroupResponse {} @@ -1665,7 +1779,19 @@ impl ::prost::Name for MsgLeaveGroupResponse { // /// Exec defines modes of execution of a proposal on creation or on new vote. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum Exec { /// An empty value means that there should be a separate @@ -5407,6 +5533,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x6e, 0x73, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x0a, 0x0a, 0x0b, 0x0a, 0x03, 0x04, 0x1b, 0x01, 0x12, 0x04, 0x89, 0x03, 0x08, 0x1d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.group.v1.serde.rs"); include!("cosmos.group.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.group.v1.serde.rs b/packages/proto/src/gen/cosmos.group.v1.serde.rs deleted file mode 100644 index 75e5af2..0000000 --- a/packages/proto/src/gen/cosmos.group.v1.serde.rs +++ /dev/null @@ -1,9845 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field("groupId", ToString::to_string(&self.group_id).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field( - "proposalId", - ToString::to_string(&self.proposal_id).as_str(), - )?; - } - if self.result != 0 { - let v = ProposalExecutorResult::from_i32(self.result).ok_or_else(|| { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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 { - struct_ser.serialize_field( - "proposalId", - ToString::to_string(&self.proposal_id).as_str(), - )?; - } - if self.status != 0 { - let v = ProposalStatus::from_i32(self.status).ok_or_else(|| { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field( - "proposalId", - ToString::to_string(&self.proposal_id).as_str(), - )?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field("groupId", ToString::to_string(&self.group_id).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field( - "proposalId", - ToString::to_string(&self.proposal_id).as_str(), - )?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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 { - struct_ser.serialize_field( - "proposalId", - ToString::to_string(&self.proposal_id).as_str(), - )?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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) - } -} -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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(Exec::from_i32) - .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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(Exec::from_i32) - .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) - } -} -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 { - 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 { - 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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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 { - 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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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 { - 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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field("groupId", ToString::to_string(&self.group_id).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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::from_i32(self.result).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.result)) - })?; - struct_ser.serialize_field("result", &v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgExecResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["result"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Result, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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 { - struct_ser.serialize_field("groupId", ToString::to_string(&self.group_id).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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; - } - if !self.title.is_empty() { - len += 1; - } - if !self.summary.is_empty() { - 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::from_i32(self.exec).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.exec)) - })?; - struct_ser.serialize_field("exec", &v)?; - } - if !self.title.is_empty() { - struct_ser.serialize_field("title", &self.title)?; - } - if !self.summary.is_empty() { - struct_ser.serialize_field("summary", &self.summary)?; - } - struct_ser.end() - } -} -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", - "title", - "summary", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - GroupPolicyAddress, - Proposers, - Metadata, - Messages, - Exec, - Title, - Summary, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "title" => Ok(GeneratedField::Title), - "summary" => Ok(GeneratedField::Summary), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSubmitProposal; - - fn expecting(&self, formatter: &mut 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; - let mut title__ = None; - let mut summary__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::GroupPolicyAddress => { - if group_policy_address__.is_some() { - return Err(serde::de::Error::duplicate_field( - "groupPolicyAddress", - )); - } - group_policy_address__ = Some(map.next_value()?); - } - GeneratedField::Proposers => { - if proposers__.is_some() { - return Err(serde::de::Error::duplicate_field("proposers")); - } - proposers__ = Some(map.next_value()?); - } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); - } - metadata__ = Some(map.next_value()?); - } - GeneratedField::Messages => { - if messages__.is_some() { - return Err(serde::de::Error::duplicate_field("messages")); - } - messages__ = Some(map.next_value()?); - } - GeneratedField::Exec => { - if exec__.is_some() { - return Err(serde::de::Error::duplicate_field("exec")); - } - exec__ = Some(map.next_value::()? as i32); - } - GeneratedField::Title => { - if title__.is_some() { - return Err(serde::de::Error::duplicate_field("title")); - } - title__ = Some(map.next_value()?); - } - GeneratedField::Summary => { - if summary__.is_some() { - return Err(serde::de::Error::duplicate_field("summary")); - } - summary__ = Some(map.next_value()?); - } - } - } - Ok(MsgSubmitProposal { - group_policy_address: group_policy_address__.unwrap_or_default(), - proposers: proposers__.unwrap_or_default(), - metadata: metadata__.unwrap_or_default(), - messages: messages__.unwrap_or_default(), - exec: exec__.unwrap_or_default(), - title: title__.unwrap_or_default(), - summary: summary__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.group.v1.MsgSubmitProposal", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgSubmitProposalResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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 { - struct_ser.serialize_field( - "proposalId", - ToString::to_string(&self.proposal_id).as_str(), - )?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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 { - 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::from_i32(self.option).ok_or_else(|| { - 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::from_i32(self.exec).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.exec)) - })?; - struct_ser.serialize_field("exec", &v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgVote { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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; - } - if !self.title.is_empty() { - len += 1; - } - if !self.summary.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.Proposal", len)?; - if self.id != 0 { - 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 { - struct_ser.serialize_field( - "groupVersion", - ToString::to_string(&self.group_version).as_str(), - )?; - } - if self.group_policy_version != 0 { - struct_ser.serialize_field( - "groupPolicyVersion", - ToString::to_string(&self.group_policy_version).as_str(), - )?; - } - if self.status != 0 { - let v = ProposalStatus::from_i32(self.status).ok_or_else(|| { - 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::from_i32(self.executor_result).ok_or_else(|| { - 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)?; - } - if !self.title.is_empty() { - struct_ser.serialize_field("title", &self.title)?; - } - if !self.summary.is_empty() { - struct_ser.serialize_field("summary", &self.summary)?; - } - struct_ser.end() - } -} -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", - "title", - "summary", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Id, - GroupPolicyAddress, - Metadata, - Proposers, - SubmitTime, - GroupVersion, - GroupPolicyVersion, - Status, - FinalTallyResult, - VotingPeriodEnd, - ExecutorResult, - Messages, - Title, - Summary, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "title" => Ok(GeneratedField::Title), - "summary" => Ok(GeneratedField::Summary), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Proposal; - - fn expecting(&self, formatter: &mut 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; - let mut title__ = None; - let mut summary__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Id => { - if id__.is_some() { - return Err(serde::de::Error::duplicate_field("id")); - } - id__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::GroupPolicyAddress => { - if group_policy_address__.is_some() { - return Err(serde::de::Error::duplicate_field( - "groupPolicyAddress", - )); - } - group_policy_address__ = Some(map.next_value()?); - } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); - } - metadata__ = Some(map.next_value()?); - } - GeneratedField::Proposers => { - if proposers__.is_some() { - return Err(serde::de::Error::duplicate_field("proposers")); - } - proposers__ = Some(map.next_value()?); - } - GeneratedField::SubmitTime => { - if submit_time__.is_some() { - return Err(serde::de::Error::duplicate_field("submitTime")); - } - submit_time__ = map.next_value()?; - } - GeneratedField::GroupVersion => { - if group_version__.is_some() { - return Err(serde::de::Error::duplicate_field("groupVersion")); - } - group_version__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::GroupPolicyVersion => { - if group_policy_version__.is_some() { - return Err(serde::de::Error::duplicate_field( - "groupPolicyVersion", - )); - } - group_policy_version__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Status => { - if status__.is_some() { - return Err(serde::de::Error::duplicate_field("status")); - } - status__ = Some(map.next_value::()? as i32); - } - GeneratedField::FinalTallyResult => { - if final_tally_result__.is_some() { - return Err(serde::de::Error::duplicate_field("finalTallyResult")); - } - final_tally_result__ = map.next_value()?; - } - GeneratedField::VotingPeriodEnd => { - if voting_period_end__.is_some() { - return Err(serde::de::Error::duplicate_field("votingPeriodEnd")); - } - voting_period_end__ = map.next_value()?; - } - GeneratedField::ExecutorResult => { - if executor_result__.is_some() { - return Err(serde::de::Error::duplicate_field("executorResult")); - } - executor_result__ = - Some(map.next_value::()? as i32); - } - GeneratedField::Messages => { - if messages__.is_some() { - return Err(serde::de::Error::duplicate_field("messages")); - } - messages__ = Some(map.next_value()?); - } - GeneratedField::Title => { - if title__.is_some() { - return Err(serde::de::Error::duplicate_field("title")); - } - title__ = Some(map.next_value()?); - } - GeneratedField::Summary => { - if summary__.is_some() { - return Err(serde::de::Error::duplicate_field("summary")); - } - summary__ = Some(map.next_value()?); - } - } - } - Ok(Proposal { - id: id__.unwrap_or_default(), - group_policy_address: group_policy_address__.unwrap_or_default(), - metadata: metadata__.unwrap_or_default(), - proposers: proposers__.unwrap_or_default(), - submit_time: submit_time__, - group_version: group_version__.unwrap_or_default(), - group_policy_version: group_policy_version__.unwrap_or_default(), - status: status__.unwrap_or_default(), - final_tally_result: final_tally_result__, - voting_period_end: voting_period_end__, - executor_result: executor_result__.unwrap_or_default(), - messages: messages__.unwrap_or_default(), - title: title__.unwrap_or_default(), - summary: summary__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.group.v1.Proposal", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for ProposalExecutorResult { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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) - } -} -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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ProposalExecutorResult::from_i32) - .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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ProposalExecutorResult::from_i32) - .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) - } -} -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) - } -} -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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ProposalStatus::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ProposalStatus::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> 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) - } -} -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 { - struct_ser.serialize_field("groupId", ToString::to_string(&self.group_id).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field( - "proposalId", - ToString::to_string(&self.proposal_id).as_str(), - )?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field( - "proposalId", - ToString::to_string(&self.proposal_id).as_str(), - )?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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::from_i32(self.option).ok_or_else(|| { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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) - } -} -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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(VoteOption::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(VoteOption::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> 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/packages/proto/src/gen/cosmos.ics23.v1.rs b/packages/proto/src/gen/cosmos.ics23.v1.rs index 807c0b6..4cf59b2 100644 --- a/packages/proto/src/gen/cosmos.ics23.v1.rs +++ b/packages/proto/src/gen/cosmos.ics23.v1.rs @@ -19,6 +19,7 @@ /// With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field /// in the ProofSpec is valuable to prevent this mutability. And why all trees should /// length-prefix the data before hashing it. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExistenceProof { @@ -42,6 +43,7 @@ impl ::prost::Name for ExistenceProof { /// NonExistenceProof takes a proof of two neighbors, one left of the desired key, /// one right of the desired key. If both proofs are valid AND they are neighbors, /// then there is no valid proof for the given key. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct NonExistenceProof { @@ -62,6 +64,7 @@ impl ::prost::Name for NonExistenceProof { } /// /// CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommitmentProof { @@ -70,6 +73,7 @@ pub struct CommitmentProof { } /// Nested message and enum types in `CommitmentProof`. pub mod commitment_proof { + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Proof { @@ -105,6 +109,7 @@ impl ::prost::Name for CommitmentProof { /// /// Then combine the bytes, and hash it /// output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LeafOp { @@ -144,6 +149,7 @@ impl ::prost::Name for LeafOp { /// Any special data, like prepending child with the length, or prepending the entire operation with /// some value to differentiate from leaf nodes, should be included in prefix and suffix. /// If either of prefix or suffix is empty, we just treat it as an empty string +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InnerOp { @@ -172,6 +178,7 @@ impl ::prost::Name for InnerOp { /// generate a given hash (by interpretting the preimage differently). /// We need this for proper security, requires client knows a priori what /// tree format server uses. But not in code, rather a configuration object. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProofSpec { @@ -204,6 +211,7 @@ impl ::prost::Name for ProofSpec { /// isLeftMost(spec: InnerSpec, op: InnerOp) /// isRightMost(spec: InnerSpec, op: InnerOp) /// isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InnerSpec { @@ -234,6 +242,7 @@ impl ::prost::Name for InnerSpec { } /// /// BatchProof is a group of multiple proof types than can be compressed +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchProof { @@ -248,6 +257,7 @@ impl ::prost::Name for BatchProof { } } /// Use BatchEntry not CommitmentProof, to avoid recursion +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchEntry { @@ -256,6 +266,7 @@ pub struct BatchEntry { } /// Nested message and enum types in `BatchEntry`. pub mod batch_entry { + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Proof { @@ -274,6 +285,7 @@ impl ::prost::Name for BatchEntry { } // ***** all items here are compressed forms ****** +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CompressedBatchProof { @@ -290,6 +302,7 @@ impl ::prost::Name for CompressedBatchProof { } } /// Use BatchEntry not CommitmentProof, to avoid recursion +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CompressedBatchEntry { @@ -298,6 +311,7 @@ pub struct CompressedBatchEntry { } /// Nested message and enum types in `CompressedBatchEntry`. pub mod compressed_batch_entry { + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Proof { @@ -314,6 +328,7 @@ impl ::prost::Name for CompressedBatchEntry { ::prost::alloc::format!("cosmos.ics23.v1.{}", Self::NAME) } } +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CompressedExistenceProof { @@ -334,6 +349,7 @@ impl ::prost::Name for CompressedExistenceProof { ::prost::alloc::format!("cosmos.ics23.v1.{}", Self::NAME) } } +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CompressedNonExistenceProof { @@ -352,7 +368,19 @@ impl ::prost::Name for CompressedNonExistenceProof { ::prost::alloc::format!("cosmos.ics23.v1.{}", Self::NAME) } } -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum HashOp { /// NO_HASH is the default if no data passed. Note this is an illegal argument some places. @@ -400,7 +428,19 @@ impl HashOp { /// to include length information. After encoding the length with the given /// algorithm, the length will be prepended to the key and value bytes. /// (Each one with it's own encoded length) -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum LengthOp { /// NO_PREFIX don't include any length info @@ -1212,5 +1252,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x01, 0x12, 0x04, 0xe8, 0x01, 0x1b, 0x20, 0x0a, 0x0d, 0x0a, 0x05, 0x04, 0x0c, 0x02, 0x02, 0x03, 0x12, 0x04, 0xe8, 0x01, 0x23, 0x24, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.ics23.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.ics23.v1.serde.rs b/packages/proto/src/gen/cosmos.ics23.v1.serde.rs deleted file mode 100644 index 5ff0562..0000000 --- a/packages/proto/src/gen/cosmos.ics23.v1.serde.rs +++ /dev/null @@ -1,2015 +0,0 @@ -// @generated -impl serde::Serialize for BatchEntry { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.proof.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.BatchEntry", len)?; - if let Some(v) = self.proof.as_ref() { - match v { - batch_entry::Proof::Exist(v) => { - struct_ser.serialize_field("exist", v)?; - } - batch_entry::Proof::Nonexist(v) => { - struct_ser.serialize_field("nonexist", v)?; - } - } - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for BatchEntry { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["exist", "nonexist"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Exist, - Nonexist, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "exist" => Ok(GeneratedField::Exist), - "nonexist" => Ok(GeneratedField::Nonexist), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = BatchEntry; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.BatchEntry") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proof__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Exist => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("exist")); - } - proof__ = map - .next_value::<::std::option::Option<_>>()? - .map(batch_entry::Proof::Exist); - } - GeneratedField::Nonexist => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("nonexist")); - } - proof__ = map - .next_value::<::std::option::Option<_>>()? - .map(batch_entry::Proof::Nonexist); - } - } - } - Ok(BatchEntry { proof: proof__ }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.BatchEntry", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for BatchProof { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.entries.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.BatchProof", len)?; - if !self.entries.is_empty() { - struct_ser.serialize_field("entries", &self.entries)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for BatchProof { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["entries"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Entries, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = BatchProof; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.BatchProof") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut entries__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Entries => { - if entries__.is_some() { - return Err(serde::de::Error::duplicate_field("entries")); - } - entries__ = Some(map.next_value()?); - } - } - } - Ok(BatchProof { - entries: entries__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.BatchProof", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for CommitmentProof { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.proof.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.CommitmentProof", len)?; - if let Some(v) = self.proof.as_ref() { - match v { - commitment_proof::Proof::Exist(v) => { - struct_ser.serialize_field("exist", v)?; - } - commitment_proof::Proof::Nonexist(v) => { - struct_ser.serialize_field("nonexist", v)?; - } - commitment_proof::Proof::Batch(v) => { - struct_ser.serialize_field("batch", v)?; - } - commitment_proof::Proof::Compressed(v) => { - struct_ser.serialize_field("compressed", v)?; - } - } - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CommitmentProof { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["exist", "nonexist", "batch", "compressed"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Exist, - Nonexist, - Batch, - Compressed, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "exist" => Ok(GeneratedField::Exist), - "nonexist" => Ok(GeneratedField::Nonexist), - "batch" => Ok(GeneratedField::Batch), - "compressed" => Ok(GeneratedField::Compressed), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CommitmentProof; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.CommitmentProof") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proof__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Exist => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("exist")); - } - proof__ = map - .next_value::<::std::option::Option<_>>()? - .map(commitment_proof::Proof::Exist); - } - GeneratedField::Nonexist => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("nonexist")); - } - proof__ = map - .next_value::<::std::option::Option<_>>()? - .map(commitment_proof::Proof::Nonexist); - } - GeneratedField::Batch => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("batch")); - } - proof__ = map - .next_value::<::std::option::Option<_>>()? - .map(commitment_proof::Proof::Batch); - } - GeneratedField::Compressed => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("compressed")); - } - proof__ = map - .next_value::<::std::option::Option<_>>()? - .map(commitment_proof::Proof::Compressed); - } - } - } - Ok(CommitmentProof { proof: proof__ }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.CommitmentProof", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for CompressedBatchEntry { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.proof.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.ics23.v1.CompressedBatchEntry", len)?; - if let Some(v) = self.proof.as_ref() { - match v { - compressed_batch_entry::Proof::Exist(v) => { - struct_ser.serialize_field("exist", v)?; - } - compressed_batch_entry::Proof::Nonexist(v) => { - struct_ser.serialize_field("nonexist", v)?; - } - } - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CompressedBatchEntry { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["exist", "nonexist"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Exist, - Nonexist, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "exist" => Ok(GeneratedField::Exist), - "nonexist" => Ok(GeneratedField::Nonexist), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CompressedBatchEntry; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.CompressedBatchEntry") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proof__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Exist => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("exist")); - } - proof__ = map - .next_value::<::std::option::Option<_>>()? - .map(compressed_batch_entry::Proof::Exist); - } - GeneratedField::Nonexist => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("nonexist")); - } - proof__ = map - .next_value::<::std::option::Option<_>>()? - .map(compressed_batch_entry::Proof::Nonexist); - } - } - } - Ok(CompressedBatchEntry { proof: proof__ }) - } - } - deserializer.deserialize_struct( - "cosmos.ics23.v1.CompressedBatchEntry", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for CompressedBatchProof { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.entries.is_empty() { - len += 1; - } - if !self.lookup_inners.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.ics23.v1.CompressedBatchProof", len)?; - if !self.entries.is_empty() { - struct_ser.serialize_field("entries", &self.entries)?; - } - if !self.lookup_inners.is_empty() { - struct_ser.serialize_field("lookupInners", &self.lookup_inners)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CompressedBatchProof { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["entries", "lookup_inners", "lookupInners"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Entries, - LookupInners, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "lookupInners" | "lookup_inners" => Ok(GeneratedField::LookupInners), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CompressedBatchProof; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.CompressedBatchProof") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut entries__ = None; - let mut lookup_inners__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Entries => { - if entries__.is_some() { - return Err(serde::de::Error::duplicate_field("entries")); - } - entries__ = Some(map.next_value()?); - } - GeneratedField::LookupInners => { - if lookup_inners__.is_some() { - return Err(serde::de::Error::duplicate_field("lookupInners")); - } - lookup_inners__ = Some(map.next_value()?); - } - } - } - Ok(CompressedBatchProof { - entries: entries__.unwrap_or_default(), - lookup_inners: lookup_inners__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.ics23.v1.CompressedBatchProof", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for CompressedExistenceProof { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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.leaf.is_some() { - len += 1; - } - if !self.path.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.ics23.v1.CompressedExistenceProof", len)?; - if !self.key.is_empty() { - struct_ser - .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if !self.value.is_empty() { - struct_ser.serialize_field( - "value", - pbjson::private::base64::encode(&self.value).as_str(), - )?; - } - if let Some(v) = self.leaf.as_ref() { - struct_ser.serialize_field("leaf", v)?; - } - if !self.path.is_empty() { - struct_ser.serialize_field("path", &self.path)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CompressedExistenceProof { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["key", "value", "leaf", "path"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Value, - Leaf, - Path, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "leaf" => Ok(GeneratedField::Leaf), - "path" => Ok(GeneratedField::Path), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CompressedExistenceProof; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.CompressedExistenceProof") - } - - 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 leaf__ = None; - let mut path__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Leaf => { - if leaf__.is_some() { - return Err(serde::de::Error::duplicate_field("leaf")); - } - leaf__ = map.next_value()?; - } - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); - } - path__ = Some( - map.next_value::>>()? - .into_iter() - .map(|x| x.0) - .collect(), - ); - } - } - } - Ok(CompressedExistenceProof { - key: key__.unwrap_or_default(), - value: value__.unwrap_or_default(), - leaf: leaf__, - path: path__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.ics23.v1.CompressedExistenceProof", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for CompressedNonExistenceProof { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.key.is_empty() { - len += 1; - } - if self.left.is_some() { - len += 1; - } - if self.right.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.ics23.v1.CompressedNonExistenceProof", len)?; - if !self.key.is_empty() { - struct_ser - .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if let Some(v) = self.left.as_ref() { - struct_ser.serialize_field("left", v)?; - } - if let Some(v) = self.right.as_ref() { - struct_ser.serialize_field("right", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CompressedNonExistenceProof { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["key", "left", "right"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Left, - Right, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "left" => Ok(GeneratedField::Left), - "right" => Ok(GeneratedField::Right), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CompressedNonExistenceProof; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.CompressedNonExistenceProof") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - let mut left__ = None; - let mut right__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Left => { - if left__.is_some() { - return Err(serde::de::Error::duplicate_field("left")); - } - left__ = map.next_value()?; - } - GeneratedField::Right => { - if right__.is_some() { - return Err(serde::de::Error::duplicate_field("right")); - } - right__ = map.next_value()?; - } - } - } - Ok(CompressedNonExistenceProof { - key: key__.unwrap_or_default(), - left: left__, - right: right__, - }) - } - } - deserializer.deserialize_struct( - "cosmos.ics23.v1.CompressedNonExistenceProof", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ExistenceProof { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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.leaf.is_some() { - len += 1; - } - if !self.path.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.ExistenceProof", len)?; - if !self.key.is_empty() { - struct_ser - .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if !self.value.is_empty() { - struct_ser.serialize_field( - "value", - pbjson::private::base64::encode(&self.value).as_str(), - )?; - } - if let Some(v) = self.leaf.as_ref() { - struct_ser.serialize_field("leaf", v)?; - } - if !self.path.is_empty() { - struct_ser.serialize_field("path", &self.path)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ExistenceProof { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["key", "value", "leaf", "path"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Value, - Leaf, - Path, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "leaf" => Ok(GeneratedField::Leaf), - "path" => Ok(GeneratedField::Path), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ExistenceProof; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.ExistenceProof") - } - - 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 leaf__ = None; - let mut path__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Leaf => { - if leaf__.is_some() { - return Err(serde::de::Error::duplicate_field("leaf")); - } - leaf__ = map.next_value()?; - } - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); - } - path__ = Some(map.next_value()?); - } - } - } - Ok(ExistenceProof { - key: key__.unwrap_or_default(), - value: value__.unwrap_or_default(), - leaf: leaf__, - path: path__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.ExistenceProof", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for HashOp { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::NoHash => "NO_HASH", - Self::Sha256 => "SHA256", - Self::Sha512 => "SHA512", - Self::Keccak => "KECCAK", - Self::Ripemd160 => "RIPEMD160", - Self::Bitcoin => "BITCOIN", - Self::Sha512256 => "SHA512_256", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for HashOp { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "NO_HASH", - "SHA256", - "SHA512", - "KECCAK", - "RIPEMD160", - "BITCOIN", - "SHA512_256", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = HashOp; - - fn expecting(&self, formatter: &mut 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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(HashOp::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(HashOp::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "NO_HASH" => Ok(HashOp::NoHash), - "SHA256" => Ok(HashOp::Sha256), - "SHA512" => Ok(HashOp::Sha512), - "KECCAK" => Ok(HashOp::Keccak), - "RIPEMD160" => Ok(HashOp::Ripemd160), - "BITCOIN" => Ok(HashOp::Bitcoin), - "SHA512_256" => Ok(HashOp::Sha512256), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for InnerOp { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.hash != 0 { - len += 1; - } - if !self.prefix.is_empty() { - len += 1; - } - if !self.suffix.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.InnerOp", len)?; - if self.hash != 0 { - let v = HashOp::from_i32(self.hash).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.hash)) - })?; - struct_ser.serialize_field("hash", &v)?; - } - if !self.prefix.is_empty() { - struct_ser.serialize_field( - "prefix", - pbjson::private::base64::encode(&self.prefix).as_str(), - )?; - } - if !self.suffix.is_empty() { - struct_ser.serialize_field( - "suffix", - pbjson::private::base64::encode(&self.suffix).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for InnerOp { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["hash", "prefix", "suffix"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Hash, - Prefix, - Suffix, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "prefix" => Ok(GeneratedField::Prefix), - "suffix" => Ok(GeneratedField::Suffix), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = InnerOp; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.InnerOp") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut hash__ = None; - let mut prefix__ = None; - let mut suffix__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Hash => { - if hash__.is_some() { - return Err(serde::de::Error::duplicate_field("hash")); - } - hash__ = Some(map.next_value::()? as i32); - } - GeneratedField::Prefix => { - if prefix__.is_some() { - return Err(serde::de::Error::duplicate_field("prefix")); - } - prefix__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Suffix => { - if suffix__.is_some() { - return Err(serde::de::Error::duplicate_field("suffix")); - } - suffix__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - } - } - Ok(InnerOp { - hash: hash__.unwrap_or_default(), - prefix: prefix__.unwrap_or_default(), - suffix: suffix__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.InnerOp", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for InnerSpec { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.child_order.is_empty() { - len += 1; - } - if self.child_size != 0 { - len += 1; - } - if self.min_prefix_length != 0 { - len += 1; - } - if self.max_prefix_length != 0 { - len += 1; - } - if !self.empty_child.is_empty() { - len += 1; - } - if self.hash != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.InnerSpec", len)?; - if !self.child_order.is_empty() { - struct_ser.serialize_field("childOrder", &self.child_order)?; - } - if self.child_size != 0 { - struct_ser.serialize_field("childSize", &self.child_size)?; - } - if self.min_prefix_length != 0 { - struct_ser.serialize_field("minPrefixLength", &self.min_prefix_length)?; - } - if self.max_prefix_length != 0 { - struct_ser.serialize_field("maxPrefixLength", &self.max_prefix_length)?; - } - if !self.empty_child.is_empty() { - struct_ser.serialize_field( - "emptyChild", - pbjson::private::base64::encode(&self.empty_child).as_str(), - )?; - } - if self.hash != 0 { - let v = HashOp::from_i32(self.hash).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.hash)) - })?; - struct_ser.serialize_field("hash", &v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for InnerSpec { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "child_order", - "childOrder", - "child_size", - "childSize", - "min_prefix_length", - "minPrefixLength", - "max_prefix_length", - "maxPrefixLength", - "empty_child", - "emptyChild", - "hash", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ChildOrder, - ChildSize, - MinPrefixLength, - MaxPrefixLength, - EmptyChild, - Hash, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "childOrder" | "child_order" => Ok(GeneratedField::ChildOrder), - "childSize" | "child_size" => Ok(GeneratedField::ChildSize), - "minPrefixLength" | "min_prefix_length" => { - Ok(GeneratedField::MinPrefixLength) - } - "maxPrefixLength" | "max_prefix_length" => { - Ok(GeneratedField::MaxPrefixLength) - } - "emptyChild" | "empty_child" => Ok(GeneratedField::EmptyChild), - "hash" => Ok(GeneratedField::Hash), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = InnerSpec; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.InnerSpec") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut child_order__ = None; - let mut child_size__ = None; - let mut min_prefix_length__ = None; - let mut max_prefix_length__ = None; - let mut empty_child__ = None; - let mut hash__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ChildOrder => { - if child_order__.is_some() { - return Err(serde::de::Error::duplicate_field("childOrder")); - } - child_order__ = Some( - map.next_value::>>()? - .into_iter() - .map(|x| x.0) - .collect(), - ); - } - GeneratedField::ChildSize => { - if child_size__.is_some() { - return Err(serde::de::Error::duplicate_field("childSize")); - } - child_size__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::MinPrefixLength => { - if min_prefix_length__.is_some() { - return Err(serde::de::Error::duplicate_field("minPrefixLength")); - } - min_prefix_length__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::MaxPrefixLength => { - if max_prefix_length__.is_some() { - return Err(serde::de::Error::duplicate_field("maxPrefixLength")); - } - max_prefix_length__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::EmptyChild => { - if empty_child__.is_some() { - return Err(serde::de::Error::duplicate_field("emptyChild")); - } - empty_child__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Hash => { - if hash__.is_some() { - return Err(serde::de::Error::duplicate_field("hash")); - } - hash__ = Some(map.next_value::()? as i32); - } - } - } - Ok(InnerSpec { - child_order: child_order__.unwrap_or_default(), - child_size: child_size__.unwrap_or_default(), - min_prefix_length: min_prefix_length__.unwrap_or_default(), - max_prefix_length: max_prefix_length__.unwrap_or_default(), - empty_child: empty_child__.unwrap_or_default(), - hash: hash__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.InnerSpec", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for LeafOp { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.hash != 0 { - len += 1; - } - if self.prehash_key != 0 { - len += 1; - } - if self.prehash_value != 0 { - len += 1; - } - if self.length != 0 { - len += 1; - } - if !self.prefix.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.LeafOp", len)?; - if self.hash != 0 { - let v = HashOp::from_i32(self.hash).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.hash)) - })?; - struct_ser.serialize_field("hash", &v)?; - } - if self.prehash_key != 0 { - let v = HashOp::from_i32(self.prehash_key).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.prehash_key)) - })?; - struct_ser.serialize_field("prehashKey", &v)?; - } - if self.prehash_value != 0 { - let v = HashOp::from_i32(self.prehash_value).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.prehash_value)) - })?; - struct_ser.serialize_field("prehashValue", &v)?; - } - if self.length != 0 { - let v = LengthOp::from_i32(self.length).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.length)) - })?; - struct_ser.serialize_field("length", &v)?; - } - if !self.prefix.is_empty() { - struct_ser.serialize_field( - "prefix", - pbjson::private::base64::encode(&self.prefix).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for LeafOp { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "hash", - "prehash_key", - "prehashKey", - "prehash_value", - "prehashValue", - "length", - "prefix", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Hash, - PrehashKey, - PrehashValue, - Length, - Prefix, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "prehashKey" | "prehash_key" => Ok(GeneratedField::PrehashKey), - "prehashValue" | "prehash_value" => Ok(GeneratedField::PrehashValue), - "length" => Ok(GeneratedField::Length), - "prefix" => Ok(GeneratedField::Prefix), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = LeafOp; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.LeafOp") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut hash__ = None; - let mut prehash_key__ = None; - let mut prehash_value__ = None; - let mut length__ = None; - let mut prefix__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Hash => { - if hash__.is_some() { - return Err(serde::de::Error::duplicate_field("hash")); - } - hash__ = Some(map.next_value::()? as i32); - } - GeneratedField::PrehashKey => { - if prehash_key__.is_some() { - return Err(serde::de::Error::duplicate_field("prehashKey")); - } - prehash_key__ = Some(map.next_value::()? as i32); - } - GeneratedField::PrehashValue => { - if prehash_value__.is_some() { - return Err(serde::de::Error::duplicate_field("prehashValue")); - } - prehash_value__ = Some(map.next_value::()? as i32); - } - GeneratedField::Length => { - if length__.is_some() { - return Err(serde::de::Error::duplicate_field("length")); - } - length__ = Some(map.next_value::()? as i32); - } - GeneratedField::Prefix => { - if prefix__.is_some() { - return Err(serde::de::Error::duplicate_field("prefix")); - } - prefix__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - } - } - Ok(LeafOp { - hash: hash__.unwrap_or_default(), - prehash_key: prehash_key__.unwrap_or_default(), - prehash_value: prehash_value__.unwrap_or_default(), - length: length__.unwrap_or_default(), - prefix: prefix__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.LeafOp", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for LengthOp { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::NoPrefix => "NO_PREFIX", - Self::VarProto => "VAR_PROTO", - Self::VarRlp => "VAR_RLP", - Self::Fixed32Big => "FIXED32_BIG", - Self::Fixed32Little => "FIXED32_LITTLE", - Self::Fixed64Big => "FIXED64_BIG", - Self::Fixed64Little => "FIXED64_LITTLE", - Self::Require32Bytes => "REQUIRE_32_BYTES", - Self::Require64Bytes => "REQUIRE_64_BYTES", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for LengthOp { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "NO_PREFIX", - "VAR_PROTO", - "VAR_RLP", - "FIXED32_BIG", - "FIXED32_LITTLE", - "FIXED64_BIG", - "FIXED64_LITTLE", - "REQUIRE_32_BYTES", - "REQUIRE_64_BYTES", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = LengthOp; - - fn expecting(&self, formatter: &mut 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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(LengthOp::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(LengthOp::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "NO_PREFIX" => Ok(LengthOp::NoPrefix), - "VAR_PROTO" => Ok(LengthOp::VarProto), - "VAR_RLP" => Ok(LengthOp::VarRlp), - "FIXED32_BIG" => Ok(LengthOp::Fixed32Big), - "FIXED32_LITTLE" => Ok(LengthOp::Fixed32Little), - "FIXED64_BIG" => Ok(LengthOp::Fixed64Big), - "FIXED64_LITTLE" => Ok(LengthOp::Fixed64Little), - "REQUIRE_32_BYTES" => Ok(LengthOp::Require32Bytes), - "REQUIRE_64_BYTES" => Ok(LengthOp::Require64Bytes), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for NonExistenceProof { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.key.is_empty() { - len += 1; - } - if self.left.is_some() { - len += 1; - } - if self.right.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.ics23.v1.NonExistenceProof", len)?; - if !self.key.is_empty() { - struct_ser - .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if let Some(v) = self.left.as_ref() { - struct_ser.serialize_field("left", v)?; - } - if let Some(v) = self.right.as_ref() { - struct_ser.serialize_field("right", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for NonExistenceProof { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["key", "left", "right"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Left, - Right, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "left" => Ok(GeneratedField::Left), - "right" => Ok(GeneratedField::Right), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = NonExistenceProof; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.NonExistenceProof") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - let mut left__ = None; - let mut right__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Left => { - if left__.is_some() { - return Err(serde::de::Error::duplicate_field("left")); - } - left__ = map.next_value()?; - } - GeneratedField::Right => { - if right__.is_some() { - return Err(serde::de::Error::duplicate_field("right")); - } - right__ = map.next_value()?; - } - } - } - Ok(NonExistenceProof { - key: key__.unwrap_or_default(), - left: left__, - right: right__, - }) - } - } - deserializer.deserialize_struct( - "cosmos.ics23.v1.NonExistenceProof", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ProofSpec { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.leaf_spec.is_some() { - len += 1; - } - if self.inner_spec.is_some() { - len += 1; - } - if self.max_depth != 0 { - len += 1; - } - if self.min_depth != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.ProofSpec", len)?; - if let Some(v) = self.leaf_spec.as_ref() { - struct_ser.serialize_field("leafSpec", v)?; - } - if let Some(v) = self.inner_spec.as_ref() { - struct_ser.serialize_field("innerSpec", v)?; - } - if self.max_depth != 0 { - struct_ser.serialize_field("maxDepth", &self.max_depth)?; - } - if self.min_depth != 0 { - struct_ser.serialize_field("minDepth", &self.min_depth)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ProofSpec { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "leaf_spec", - "leafSpec", - "inner_spec", - "innerSpec", - "max_depth", - "maxDepth", - "min_depth", - "minDepth", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - LeafSpec, - InnerSpec, - MaxDepth, - MinDepth, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "leafSpec" | "leaf_spec" => Ok(GeneratedField::LeafSpec), - "innerSpec" | "inner_spec" => Ok(GeneratedField::InnerSpec), - "maxDepth" | "max_depth" => Ok(GeneratedField::MaxDepth), - "minDepth" | "min_depth" => Ok(GeneratedField::MinDepth), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ProofSpec; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.ics23.v1.ProofSpec") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut leaf_spec__ = None; - let mut inner_spec__ = None; - let mut max_depth__ = None; - let mut min_depth__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::LeafSpec => { - if leaf_spec__.is_some() { - return Err(serde::de::Error::duplicate_field("leafSpec")); - } - leaf_spec__ = map.next_value()?; - } - GeneratedField::InnerSpec => { - if inner_spec__.is_some() { - return Err(serde::de::Error::duplicate_field("innerSpec")); - } - inner_spec__ = map.next_value()?; - } - GeneratedField::MaxDepth => { - if max_depth__.is_some() { - return Err(serde::de::Error::duplicate_field("maxDepth")); - } - max_depth__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::MinDepth => { - if min_depth__.is_some() { - return Err(serde::de::Error::duplicate_field("minDepth")); - } - min_depth__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(ProofSpec { - leaf_spec: leaf_spec__, - inner_spec: inner_spec__, - max_depth: max_depth__.unwrap_or_default(), - min_depth: min_depth__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.ics23.v1.ProofSpec", FIELDS, GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/cosmos.mint.module.v1.rs b/packages/proto/src/gen/cosmos.mint.module.v1.rs index c2ad216..836b35a 100644 --- a/packages/proto/src/gen/cosmos.mint.module.v1.rs +++ b/packages/proto/src/gen/cosmos.mint.module.v1.rs @@ -1,5 +1,6 @@ // @generated /// Module is the config object of the mint module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module { @@ -59,5 +60,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x00, 0x02, 0x01, 0x01, 0x12, 0x03, 0x0f, 0x09, 0x12, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x01, 0x03, 0x12, 0x03, 0x0f, 0x15, 0x16, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.mint.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.mint.module.v1.serde.rs b/packages/proto/src/gen/cosmos.mint.module.v1.serde.rs deleted file mode 100644 index b131b7c..0000000 --- a/packages/proto/src/gen/cosmos.mint.module.v1.serde.rs +++ /dev/null @@ -1,111 +0,0 @@ -// @generated -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.fee_collector_name.is_empty() { - len += 1; - } - if !self.authority.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.mint.module.v1.Module", len)?; - if !self.fee_collector_name.is_empty() { - struct_ser.serialize_field("feeCollectorName", &self.fee_collector_name)?; - } - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Module { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["fee_collector_name", "feeCollectorName", "authority"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - FeeCollectorName, - Authority, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "feeCollectorName" | "fee_collector_name" => { - Ok(GeneratedField::FeeCollectorName) - } - "authority" => Ok(GeneratedField::Authority), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Module; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.mint.module.v1.Module") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut fee_collector_name__ = None; - let mut authority__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::FeeCollectorName => { - if fee_collector_name__.is_some() { - return Err(serde::de::Error::duplicate_field("feeCollectorName")); - } - fee_collector_name__ = Some(map.next_value()?); - } - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map.next_value()?); - } - } - } - Ok(Module { - fee_collector_name: fee_collector_name__.unwrap_or_default(), - authority: authority__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.mint.module.v1.Module", FIELDS, GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/cosmos.mint.v1beta1.rs b/packages/proto/src/gen/cosmos.mint.v1beta1.rs index 4a53b1f..c0d55bb 100644 --- a/packages/proto/src/gen/cosmos.mint.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.mint.v1beta1.rs @@ -1,5 +1,6 @@ // @generated /// Minter represents the minting state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Minter { @@ -18,6 +19,7 @@ impl ::prost::Name for Minter { } } /// Params defines the parameters for the x/mint module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -48,6 +50,7 @@ impl ::prost::Name for Params { } } /// GenesisState defines the mint module's genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -66,6 +69,7 @@ impl ::prost::Name for GenesisState { } } /// QueryParamsRequest is the request type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} @@ -77,6 +81,7 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse is the response type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -92,6 +97,7 @@ impl ::prost::Name for QueryParamsResponse { } } /// QueryInflationRequest is the request type for the Query/Inflation RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryInflationRequest {} @@ -104,6 +110,7 @@ impl ::prost::Name for QueryInflationRequest { } /// QueryInflationResponse is the response type for the Query/Inflation RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryInflationResponse { @@ -120,6 +127,7 @@ impl ::prost::Name for QueryInflationResponse { } /// QueryAnnualProvisionsRequest is the request type for the /// Query/AnnualProvisions RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAnnualProvisionsRequest {} @@ -132,6 +140,7 @@ impl ::prost::Name for QueryAnnualProvisionsRequest { } /// QueryAnnualProvisionsResponse is the response type for the /// Query/AnnualProvisions RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAnnualProvisionsResponse { @@ -149,6 +158,7 @@ impl ::prost::Name for QueryAnnualProvisionsResponse { /// MsgUpdateParams is the Msg/UpdateParams request type. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -172,6 +182,7 @@ impl ::prost::Name for MsgUpdateParams { /// MsgUpdateParams message. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} @@ -665,6 +676,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x20, 0x30, 0x2e, 0x34, 0x37, 0x0a, 0x0a, 0x0a, 0x0a, 0x03, 0x04, 0x01, 0x01, 0x12, 0x03, 0x2a, 0x08, 0x1f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.mint.v1beta1.serde.rs"); include!("cosmos.mint.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.mint.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.mint.v1beta1.serde.rs deleted file mode 100644 index af559e5..0000000 --- a/packages/proto/src/gen/cosmos.mint.v1beta1.serde.rs +++ /dev/null @@ -1,1156 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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("cosmos.mint.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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 cosmos.mint.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( - "cosmos.mint.v1beta1.MsgUpdateParams", - FIELDS, - GeneratedVisitor, - ) - } -} -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("cosmos.mint.v1beta1.MsgUpdateParamsResponse", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 cosmos.mint.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( - "cosmos.mint.v1beta1.MsgUpdateParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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 { - struct_ser.serialize_field( - "blocksPerYear", - ToString::to_string(&self.blocks_per_year).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Params { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() { - struct_ser.serialize_field( - "annualProvisions", - pbjson::private::base64::encode(&self.annual_provisions).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryAnnualProvisionsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["annual_provisions", "annualProvisions"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - AnnualProvisions, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() { - struct_ser.serialize_field( - "inflation", - pbjson::private::base64::encode(&self.inflation).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryInflationResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["inflation"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Inflation, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.nft.module.v1.rs b/packages/proto/src/gen/cosmos.nft.module.v1.rs index 632ab12..f4f6e74 100644 --- a/packages/proto/src/gen/cosmos.nft.module.v1.rs +++ b/packages/proto/src/gen/cosmos.nft.module.v1.rs @@ -1,5 +1,6 @@ // @generated /// Module is the config object of the nft module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module {} @@ -35,5 +36,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x12, 0x04, 0x08, 0x02, 0x0a, 0x04, 0x0a, 0x0f, 0x0a, 0x08, 0x04, 0x00, 0x07, 0x87, 0xe8, 0xa2, 0x1b, 0x01, 0x12, 0x03, 0x09, 0x04, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.nft.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.nft.module.v1.serde.rs b/packages/proto/src/gen/cosmos.nft.module.v1.serde.rs deleted file mode 100644 index c951550..0000000 --- a/packages/proto/src/gen/cosmos.nft.module.v1.serde.rs +++ /dev/null @@ -1,72 +0,0 @@ -// @generated -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.nft.module.v1.Module", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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.nft.module.v1.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.nft.module.v1.Module", FIELDS, GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/cosmos.nft.v1beta1.rs b/packages/proto/src/gen/cosmos.nft.v1beta1.rs index 9c65504..7c9fb2c 100644 --- a/packages/proto/src/gen/cosmos.nft.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.nft.v1beta1.rs @@ -1,5 +1,6 @@ // @generated /// EventSend is emitted on Msg/Send +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventSend { @@ -24,6 +25,7 @@ impl ::prost::Name for EventSend { } } /// EventMint is emitted on Mint +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventMint { @@ -45,6 +47,7 @@ impl ::prost::Name for EventMint { } } /// EventBurn is emitted on Burn +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventBurn { @@ -66,6 +69,7 @@ impl ::prost::Name for EventBurn { } } /// Class defines the class of the nft type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Class { @@ -99,6 +103,7 @@ impl ::prost::Name for Class { } } /// NFT defines the NFT. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Nft { @@ -126,6 +131,7 @@ impl ::prost::Name for Nft { } } /// GenesisState defines the nft module's genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -144,6 +150,7 @@ impl ::prost::Name for GenesisState { } } /// Entry Defines all nft owned by a person +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Entry { @@ -162,6 +169,7 @@ impl ::prost::Name for Entry { } } /// QueryBalanceRequest is the request type for the Query/Balance RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBalanceRequest { @@ -180,6 +188,7 @@ impl ::prost::Name for QueryBalanceRequest { } } /// QueryBalanceResponse is the response type for the Query/Balance RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBalanceResponse { @@ -195,6 +204,7 @@ impl ::prost::Name for QueryBalanceResponse { } } /// QueryOwnerRequest is the request type for the Query/Owner RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryOwnerRequest { @@ -213,6 +223,7 @@ impl ::prost::Name for QueryOwnerRequest { } } /// QueryOwnerResponse is the response type for the Query/Owner RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryOwnerResponse { @@ -228,6 +239,7 @@ impl ::prost::Name for QueryOwnerResponse { } } /// QuerySupplyRequest is the request type for the Query/Supply RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySupplyRequest { @@ -243,6 +255,7 @@ impl ::prost::Name for QuerySupplyRequest { } } /// QuerySupplyResponse is the response type for the Query/Supply RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySupplyResponse { @@ -258,6 +271,7 @@ impl ::prost::Name for QuerySupplyResponse { } } /// QueryNFTstRequest is the request type for the Query/NFTs RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNfTsRequest { @@ -279,6 +293,7 @@ impl ::prost::Name for QueryNfTsRequest { } } /// QueryNFTsResponse is the response type for the Query/NFTs RPC methods +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNfTsResponse { @@ -297,6 +312,7 @@ impl ::prost::Name for QueryNfTsResponse { } } /// QueryNFTRequest is the request type for the Query/NFT RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNftRequest { @@ -315,6 +331,7 @@ impl ::prost::Name for QueryNftRequest { } } /// QueryNFTResponse is the response type for the Query/NFT RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNftResponse { @@ -330,6 +347,7 @@ impl ::prost::Name for QueryNftResponse { } } /// QueryClassRequest is the request type for the Query/Class RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClassRequest { @@ -345,6 +363,7 @@ impl ::prost::Name for QueryClassRequest { } } /// QueryClassResponse is the response type for the Query/Class RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClassResponse { @@ -360,6 +379,7 @@ impl ::prost::Name for QueryClassResponse { } } /// QueryClassesRequest is the request type for the Query/Classes RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClassesRequest { @@ -375,6 +395,7 @@ impl ::prost::Name for QueryClassesRequest { } } /// QueryClassesResponse is the response type for the Query/Classes RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClassesResponse { @@ -393,6 +414,7 @@ impl ::prost::Name for QueryClassesResponse { } } /// MsgSend represents a message to send a nft from one account to another account. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSend { @@ -417,6 +439,7 @@ impl ::prost::Name for MsgSend { } } /// MsgSendResponse defines the Msg/Send response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSendResponse {} @@ -1258,6 +1281,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x2e, 0x0a, 0x0a, 0x0a, 0x0a, 0x03, 0x04, 0x01, 0x01, 0x12, 0x03, 0x21, 0x08, 0x17, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.nft.v1beta1.serde.rs"); include!("cosmos.nft.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.nft.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.nft.v1beta1.serde.rs deleted file mode 100644 index 6d1970c..0000000 --- a/packages/proto/src/gen/cosmos.nft.v1beta1.serde.rs +++ /dev/null @@ -1,2647 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field("amount", ToString::to_string(&self.amount).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field("amount", ToString::to_string(&self.amount).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.orm.module.v1alpha1.rs b/packages/proto/src/gen/cosmos.orm.module.v1alpha1.rs index 345c1f5..a87ab4b 100644 --- a/packages/proto/src/gen/cosmos.orm.module.v1alpha1.rs +++ b/packages/proto/src/gen/cosmos.orm.module.v1alpha1.rs @@ -2,6 +2,7 @@ /// 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module {} @@ -46,5 +47,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x0f, 0x0a, 0x08, 0x04, 0x00, 0x07, 0x87, 0xe8, 0xa2, 0x1b, 0x01, 0x12, 0x03, 0x0b, 0x04, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.orm.module.v1alpha1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.orm.module.v1alpha1.serde.rs b/packages/proto/src/gen/cosmos.orm.module.v1alpha1.serde.rs deleted file mode 100644 index ff0688b..0000000 --- a/packages/proto/src/gen/cosmos.orm.module.v1alpha1.serde.rs +++ /dev/null @@ -1,76 +0,0 @@ -// @generated -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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/packages/proto/src/gen/cosmos.orm.query.v1alpha1.rs b/packages/proto/src/gen/cosmos.orm.query.v1alpha1.rs index 0938992..ad94498 100644 --- a/packages/proto/src/gen/cosmos.orm.query.v1alpha1.rs +++ b/packages/proto/src/gen/cosmos.orm.query.v1alpha1.rs @@ -1,5 +1,6 @@ // @generated /// GetRequest is the Query/Get request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetRequest { @@ -25,6 +26,7 @@ impl ::prost::Name for GetRequest { } } /// GetResponse is the Query/Get response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetResponse { @@ -41,6 +43,7 @@ impl ::prost::Name for GetResponse { } } /// ListRequest is the Query/List request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListRequest { @@ -63,6 +66,7 @@ pub struct ListRequest { /// Nested message and enum types in `ListRequest`. pub mod list_request { /// Prefix specifies the arguments to a prefix query. + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Prefix { @@ -80,6 +84,7 @@ pub mod list_request { } } /// Range specifies the arguments to a range query. + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Range { @@ -104,6 +109,7 @@ pub mod list_request { /// query is the query expression corresponding to the provided index. If /// neither prefix nor range is specified, the query will list all the fields /// in the index. + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Query { @@ -123,6 +129,7 @@ impl ::prost::Name for ListRequest { } } /// ListResponse is the Query/List response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListResponse { @@ -141,6 +148,7 @@ impl ::prost::Name for ListResponse { } } /// IndexValue represents the value of a field in an ORM index expression. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IndexValue { @@ -151,6 +159,7 @@ pub struct IndexValue { /// Nested message and enum types in `IndexValue`. pub mod index_value { /// value specifies the index value + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Value { @@ -564,6 +573,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x04, 0x04, 0x02, 0x07, 0x03, 0x12, 0x04, 0x80, 0x01, 0x28, 0x29, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.orm.query.v1alpha1.serde.rs"); include!("cosmos.orm.query.v1alpha1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.orm.query.v1alpha1.serde.rs b/packages/proto/src/gen/cosmos.orm.query.v1alpha1.serde.rs deleted file mode 100644 index c80856f..0000000 --- a/packages/proto/src/gen/cosmos.orm.query.v1alpha1.serde.rs +++ /dev/null @@ -1,915 +0,0 @@ -// @generated -impl serde::Serialize for GetRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.message_name.is_empty() { - len += 1; - } - if !self.index.is_empty() { - len += 1; - } - if !self.values.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.orm.query.v1alpha1.GetRequest", len)?; - if !self.message_name.is_empty() { - struct_ser.serialize_field("messageName", &self.message_name)?; - } - if !self.index.is_empty() { - struct_ser.serialize_field("index", &self.index)?; - } - if !self.values.is_empty() { - struct_ser.serialize_field("values", &self.values)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GetRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["message_name", "messageName", "index", "values"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - MessageName, - Index, - Values, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "messageName" | "message_name" => Ok(GeneratedField::MessageName), - "index" => Ok(GeneratedField::Index), - "values" => Ok(GeneratedField::Values), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GetRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.orm.query.v1alpha1.GetRequest") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut message_name__ = None; - let mut index__ = None; - let mut values__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::MessageName => { - if message_name__.is_some() { - return Err(serde::de::Error::duplicate_field("messageName")); - } - message_name__ = Some(map.next_value()?); - } - GeneratedField::Index => { - if index__.is_some() { - return Err(serde::de::Error::duplicate_field("index")); - } - index__ = Some(map.next_value()?); - } - GeneratedField::Values => { - if values__.is_some() { - return Err(serde::de::Error::duplicate_field("values")); - } - values__ = Some(map.next_value()?); - } - } - } - Ok(GetRequest { - message_name: message_name__.unwrap_or_default(), - index: index__.unwrap_or_default(), - values: values__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.orm.query.v1alpha1.GetRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for GetResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.result.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.orm.query.v1alpha1.GetResponse", len)?; - if let Some(v) = self.result.as_ref() { - struct_ser.serialize_field("result", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GetResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["result"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Result, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = GetResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.orm.query.v1alpha1.GetResponse") - } - - 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__ = map.next_value()?; - } - } - } - Ok(GetResponse { result: result__ }) - } - } - deserializer.deserialize_struct( - "cosmos.orm.query.v1alpha1.GetResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for IndexValue { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.value.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.orm.query.v1alpha1.IndexValue", len)?; - if let Some(v) = self.value.as_ref() { - match v { - index_value::Value::Uint(v) => { - struct_ser.serialize_field("uint", ToString::to_string(&v).as_str())?; - } - index_value::Value::Int(v) => { - struct_ser.serialize_field("int", ToString::to_string(&v).as_str())?; - } - index_value::Value::Str(v) => { - struct_ser.serialize_field("str", v)?; - } - index_value::Value::Bytes(v) => { - struct_ser - .serialize_field("bytes", pbjson::private::base64::encode(&v).as_str())?; - } - index_value::Value::Enum(v) => { - struct_ser.serialize_field("enum", v)?; - } - index_value::Value::Bool(v) => { - struct_ser.serialize_field("bool", v)?; - } - index_value::Value::Timestamp(v) => { - struct_ser.serialize_field("timestamp", v)?; - } - index_value::Value::Duration(v) => { - struct_ser.serialize_field("duration", v)?; - } - } - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for IndexValue { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "uint", - "int", - "str", - "bytes", - "enum", - "bool", - "timestamp", - "duration", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Uint, - Int, - Str, - Bytes, - Enum, - Bool, - Timestamp, - Duration, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "uint" => Ok(GeneratedField::Uint), - "int" => Ok(GeneratedField::Int), - "str" => Ok(GeneratedField::Str), - "bytes" => Ok(GeneratedField::Bytes), - "enum" => Ok(GeneratedField::Enum), - "bool" => Ok(GeneratedField::Bool), - "timestamp" => Ok(GeneratedField::Timestamp), - "duration" => Ok(GeneratedField::Duration), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IndexValue; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.orm.query.v1alpha1.IndexValue") - } - - 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::Uint => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("uint")); - } - value__ = map.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| index_value::Value::Uint(x.0)); - } - GeneratedField::Int => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("int")); - } - value__ = map.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| index_value::Value::Int(x.0)); - } - GeneratedField::Str => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("str")); - } - value__ = map - .next_value::<::std::option::Option<_>>()? - .map(index_value::Value::Str); - } - GeneratedField::Bytes => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("bytes")); - } - value__ = map.next_value::<::std::option::Option<::pbjson::private::BytesDeserialize<_>>>()?.map(|x| index_value::Value::Bytes(x.0)); - } - GeneratedField::Enum => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("enum")); - } - value__ = map - .next_value::<::std::option::Option<_>>()? - .map(index_value::Value::Enum); - } - GeneratedField::Bool => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("bool")); - } - value__ = map - .next_value::<::std::option::Option<_>>()? - .map(index_value::Value::Bool); - } - GeneratedField::Timestamp => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); - } - value__ = map - .next_value::<::std::option::Option<_>>()? - .map(index_value::Value::Timestamp); - } - GeneratedField::Duration => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("duration")); - } - value__ = map - .next_value::<::std::option::Option<_>>()? - .map(index_value::Value::Duration); - } - } - } - Ok(IndexValue { value: value__ }) - } - } - deserializer.deserialize_struct( - "cosmos.orm.query.v1alpha1.IndexValue", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ListRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.message_name.is_empty() { - len += 1; - } - if !self.index.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - if self.query.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.orm.query.v1alpha1.ListRequest", len)?; - if !self.message_name.is_empty() { - struct_ser.serialize_field("messageName", &self.message_name)?; - } - if !self.index.is_empty() { - struct_ser.serialize_field("index", &self.index)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - if let Some(v) = self.query.as_ref() { - match v { - list_request::Query::Prefix(v) => { - struct_ser.serialize_field("prefix", v)?; - } - list_request::Query::Range(v) => { - struct_ser.serialize_field("range", v)?; - } - } - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ListRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "message_name", - "messageName", - "index", - "pagination", - "prefix", - "range", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - MessageName, - Index, - Pagination, - Prefix, - Range, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "messageName" | "message_name" => Ok(GeneratedField::MessageName), - "index" => Ok(GeneratedField::Index), - "pagination" => Ok(GeneratedField::Pagination), - "prefix" => Ok(GeneratedField::Prefix), - "range" => Ok(GeneratedField::Range), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.orm.query.v1alpha1.ListRequest") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut message_name__ = None; - let mut index__ = None; - let mut pagination__ = None; - let mut query__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::MessageName => { - if message_name__.is_some() { - return Err(serde::de::Error::duplicate_field("messageName")); - } - message_name__ = Some(map.next_value()?); - } - GeneratedField::Index => { - if index__.is_some() { - return Err(serde::de::Error::duplicate_field("index")); - } - index__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - GeneratedField::Prefix => { - if query__.is_some() { - return Err(serde::de::Error::duplicate_field("prefix")); - } - query__ = map - .next_value::<::std::option::Option<_>>()? - .map(list_request::Query::Prefix); - } - GeneratedField::Range => { - if query__.is_some() { - return Err(serde::de::Error::duplicate_field("range")); - } - query__ = map - .next_value::<::std::option::Option<_>>()? - .map(list_request::Query::Range); - } - } - } - Ok(ListRequest { - message_name: message_name__.unwrap_or_default(), - index: index__.unwrap_or_default(), - pagination: pagination__, - query: query__, - }) - } - } - deserializer.deserialize_struct( - "cosmos.orm.query.v1alpha1.ListRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for list_request::Prefix { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.values.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.orm.query.v1alpha1.ListRequest.Prefix", len)?; - if !self.values.is_empty() { - struct_ser.serialize_field("values", &self.values)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for list_request::Prefix { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["values"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Values, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "values" => Ok(GeneratedField::Values), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = list_request::Prefix; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.orm.query.v1alpha1.ListRequest.Prefix") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut values__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Values => { - if values__.is_some() { - return Err(serde::de::Error::duplicate_field("values")); - } - values__ = Some(map.next_value()?); - } - } - } - Ok(list_request::Prefix { - values: values__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.orm.query.v1alpha1.ListRequest.Prefix", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for list_request::Range { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.start.is_empty() { - len += 1; - } - if !self.end.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.orm.query.v1alpha1.ListRequest.Range", len)?; - if !self.start.is_empty() { - struct_ser.serialize_field("start", &self.start)?; - } - if !self.end.is_empty() { - struct_ser.serialize_field("end", &self.end)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for list_request::Range { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["start", "end"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Start, - End, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "start" => Ok(GeneratedField::Start), - "end" => Ok(GeneratedField::End), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = list_request::Range; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.orm.query.v1alpha1.ListRequest.Range") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut start__ = None; - let mut end__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Start => { - if start__.is_some() { - return Err(serde::de::Error::duplicate_field("start")); - } - start__ = Some(map.next_value()?); - } - GeneratedField::End => { - if end__.is_some() { - return Err(serde::de::Error::duplicate_field("end")); - } - end__ = Some(map.next_value()?); - } - } - } - Ok(list_request::Range { - start: start__.unwrap_or_default(), - end: end__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.orm.query.v1alpha1.ListRequest.Range", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ListResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.results.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.orm.query.v1alpha1.ListResponse", len)?; - if !self.results.is_empty() { - struct_ser.serialize_field("results", &self.results)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ListResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["results", "pagination"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Results, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.orm.query.v1alpha1.ListResponse") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut results__ = None; - let mut pagination__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Results => { - if results__.is_some() { - return Err(serde::de::Error::duplicate_field("results")); - } - results__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - } - } - Ok(ListResponse { - results: results__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct( - "cosmos.orm.query.v1alpha1.ListResponse", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/cosmos.orm.v1.rs b/packages/proto/src/gen/cosmos.orm.v1.rs index e2522e5..0911622 100644 --- a/packages/proto/src/gen/cosmos.orm.v1.rs +++ b/packages/proto/src/gen/cosmos.orm.v1.rs @@ -1,5 +1,6 @@ // @generated /// TableDescriptor describes an ORM table. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TableDescriptor { @@ -23,6 +24,7 @@ impl ::prost::Name for TableDescriptor { } } /// PrimaryKeyDescriptor describes a table primary key. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PrimaryKeyDescriptor { @@ -72,6 +74,7 @@ impl ::prost::Name for PrimaryKeyDescriptor { } } /// PrimaryKeyDescriptor describes a table secondary index. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SecondaryIndexDescriptor { @@ -103,6 +106,7 @@ impl ::prost::Name for SecondaryIndexDescriptor { } } /// TableDescriptor describes an ORM singleton table which has at most one instance. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SingletonDescriptor { @@ -443,5 +447,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x0c, 0x0a, 0x05, 0x04, 0x03, 0x02, 0x00, 0x03, 0x12, 0x03, 0x66, 0x0e, 0x0f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.orm.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.orm.v1.serde.rs b/packages/proto/src/gen/cosmos.orm.v1.serde.rs deleted file mode 100644 index 293b88d..0000000 --- a/packages/proto/src/gen/cosmos.orm.v1.serde.rs +++ /dev/null @@ -1,476 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.orm.v1alpha1.rs b/packages/proto/src/gen/cosmos.orm.v1alpha1.rs index cca1a24..b7c911f 100644 --- a/packages/proto/src/gen/cosmos.orm.v1alpha1.rs +++ b/packages/proto/src/gen/cosmos.orm.v1alpha1.rs @@ -1,5 +1,6 @@ // @generated /// ModuleSchemaDescriptor describe's a module's ORM schema. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleSchemaDescriptor { @@ -13,6 +14,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. + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FileEntry { @@ -47,7 +49,19 @@ impl ::prost::Name for ModuleSchemaDescriptor { } } /// StorageType -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum StorageType { /// STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent @@ -345,5 +359,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x0c, 0x0a, 0x05, 0x05, 0x00, 0x02, 0x04, 0x02, 0x12, 0x03, 0x4a, 0x1c, 0x1d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.orm.v1alpha1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.orm.v1alpha1.serde.rs b/packages/proto/src/gen/cosmos.orm.v1alpha1.serde.rs deleted file mode 100644 index 5c090e1..0000000 --- a/packages/proto/src/gen/cosmos.orm.v1alpha1.serde.rs +++ /dev/null @@ -1,351 +0,0 @@ -// @generated -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() { - struct_ser.serialize_field( - "prefix", - pbjson::private::base64::encode(&self.prefix).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ModuleSchemaDescriptor { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["schema_file", "schemaFile", "prefix"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SchemaFile, - Prefix, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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::from_i32(self.storage_type).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.storage_type)) - })?; - struct_ser.serialize_field("storageType", &v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for module_schema_descriptor::FileEntry { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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) - } -} -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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(StorageType::from_i32) - .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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(StorageType::from_i32) - .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/packages/proto/src/gen/cosmos.params.module.v1.rs b/packages/proto/src/gen/cosmos.params.module.v1.rs index 7c48090..6a71abf 100644 --- a/packages/proto/src/gen/cosmos.params.module.v1.rs +++ b/packages/proto/src/gen/cosmos.params.module.v1.rs @@ -1,5 +1,6 @@ // @generated /// Module is the config object of the params module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module {} @@ -36,5 +37,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x0a, 0x04, 0x0a, 0x0f, 0x0a, 0x08, 0x04, 0x00, 0x07, 0x87, 0xe8, 0xa2, 0x1b, 0x01, 0x12, 0x03, 0x09, 0x04, 0x36, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.params.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.params.module.v1.serde.rs b/packages/proto/src/gen/cosmos.params.module.v1.serde.rs deleted file mode 100644 index ea00606..0000000 --- a/packages/proto/src/gen/cosmos.params.module.v1.serde.rs +++ /dev/null @@ -1,72 +0,0 @@ -// @generated -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.params.module.v1.Module", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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.params.module.v1.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.params.module.v1.Module", FIELDS, GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/cosmos.params.v1beta1.rs b/packages/proto/src/gen/cosmos.params.v1beta1.rs index 93c0869..9601ed2 100644 --- a/packages/proto/src/gen/cosmos.params.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.params.v1beta1.rs @@ -1,5 +1,6 @@ // @generated /// ParameterChangeProposal defines a proposal to change one or more parameters. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ParameterChangeProposal { @@ -19,6 +20,7 @@ impl ::prost::Name for ParameterChangeProposal { } /// ParamChange defines an individual parameter change, for use in /// ParameterChangeProposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ParamChange { @@ -37,6 +39,7 @@ impl ::prost::Name for ParamChange { } } /// QueryParamsRequest is request type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest { @@ -55,6 +58,7 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse is response type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -73,6 +77,7 @@ impl ::prost::Name for QueryParamsResponse { /// subspaces and all keys for a subspace. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySubspacesRequest {} @@ -87,6 +92,7 @@ impl ::prost::Name for QuerySubspacesRequest { /// registered subspaces and all keys for a subspace. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySubspacesResponse { @@ -104,6 +110,7 @@ impl ::prost::Name for QuerySubspacesResponse { /// the subspace. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Subspace { @@ -375,6 +382,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x01, 0x01, 0x12, 0x03, 0x3d, 0x12, 0x16, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x04, 0x02, 0x01, 0x03, 0x12, 0x03, 0x3d, 0x1d, 0x1e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.params.v1beta1.serde.rs"); include!("cosmos.params.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.params.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.params.v1beta1.serde.rs deleted file mode 100644 index b39d099..0000000 --- a/packages/proto/src/gen/cosmos.params.v1beta1.serde.rs +++ /dev/null @@ -1,757 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.reflection.v1.rs b/packages/proto/src/gen/cosmos.reflection.v1.rs index 1492958..1e4c474 100644 --- a/packages/proto/src/gen/cosmos.reflection.v1.rs +++ b/packages/proto/src/gen/cosmos.reflection.v1.rs @@ -1,5 +1,6 @@ // @generated /// FileDescriptorsRequest is the Query/FileDescriptors request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FileDescriptorsRequest {} @@ -11,6 +12,7 @@ impl ::prost::Name for FileDescriptorsRequest { } } /// FileDescriptorsResponse is the Query/FileDescriptors response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FileDescriptorsResponse { @@ -106,6 +108,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x12, 0x03, 0x19, 0x2f, 0x34, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x00, 0x03, 0x12, 0x03, 0x19, 0x37, 0x38, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.reflection.v1.serde.rs"); include!("cosmos.reflection.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.reflection.v1.serde.rs b/packages/proto/src/gen/cosmos.reflection.v1.serde.rs deleted file mode 100644 index d05b52e..0000000 --- a/packages/proto/src/gen/cosmos.reflection.v1.serde.rs +++ /dev/null @@ -1,180 +0,0 @@ -// @generated -impl serde::Serialize for FileDescriptorsRequest { - #[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.reflection.v1.FileDescriptorsRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for FileDescriptorsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = FileDescriptorsRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.reflection.v1.FileDescriptorsRequest") - } - - 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(FileDescriptorsRequest {}) - } - } - deserializer.deserialize_struct( - "cosmos.reflection.v1.FileDescriptorsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for FileDescriptorsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.files.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.reflection.v1.FileDescriptorsResponse", len)?; - if !self.files.is_empty() { - struct_ser.serialize_field("files", &self.files)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for FileDescriptorsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["files"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Files, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "files" => Ok(GeneratedField::Files), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = FileDescriptorsResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.reflection.v1.FileDescriptorsResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut files__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Files => { - if files__.is_some() { - return Err(serde::de::Error::duplicate_field("files")); - } - files__ = Some(map.next_value()?); - } - } - } - Ok(FileDescriptorsResponse { - files: files__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.reflection.v1.FileDescriptorsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/cosmos.slashing.module.v1.rs b/packages/proto/src/gen/cosmos.slashing.module.v1.rs index 477a31a..a048ebf 100644 --- a/packages/proto/src/gen/cosmos.slashing.module.v1.rs +++ b/packages/proto/src/gen/cosmos.slashing.module.v1.rs @@ -1,5 +1,6 @@ // @generated /// Module is the config object of the slashing module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module { @@ -52,5 +53,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x0d, 0x09, 0x12, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x00, 0x03, 0x12, 0x03, 0x0d, 0x15, 0x16, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.slashing.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.slashing.module.v1.serde.rs b/packages/proto/src/gen/cosmos.slashing.module.v1.serde.rs deleted file mode 100644 index 6d9eafb..0000000 --- a/packages/proto/src/gen/cosmos.slashing.module.v1.serde.rs +++ /dev/null @@ -1,98 +0,0 @@ -// @generated -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.authority.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.slashing.module.v1.Module", len)?; - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Module { - #[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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = Module; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.slashing.module.v1.Module") - } - - 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(Module { - authority: authority__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.slashing.module.v1.Module", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/cosmos.slashing.v1beta1.rs b/packages/proto/src/gen/cosmos.slashing.v1beta1.rs index cc5cf4f..896760b 100644 --- a/packages/proto/src/gen/cosmos.slashing.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.slashing.v1beta1.rs @@ -1,6 +1,7 @@ // @generated /// ValidatorSigningInfo defines a validator's signing info for monitoring their /// liveness activity. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorSigningInfo { @@ -34,6 +35,7 @@ impl ::prost::Name for ValidatorSigningInfo { } } /// Params represents the parameters used for by the slashing module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -56,6 +58,7 @@ impl ::prost::Name for Params { } } /// GenesisState defines the slashing module's genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -79,6 +82,7 @@ impl ::prost::Name for GenesisState { } } /// SigningInfo stores validator signing info of corresponding address. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SigningInfo { @@ -98,6 +102,7 @@ impl ::prost::Name for SigningInfo { } /// ValidatorMissedBlocks contains array of missed blocks of corresponding /// address. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorMissedBlocks { @@ -116,6 +121,7 @@ impl ::prost::Name for ValidatorMissedBlocks { } } /// MissedBlock contains height and missed status as boolean. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MissedBlock { @@ -134,6 +140,7 @@ impl ::prost::Name for MissedBlock { } } /// QueryParamsRequest is the request type for the Query/Params RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} @@ -145,6 +152,7 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse is the response type for the Query/Params RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -160,6 +168,7 @@ impl ::prost::Name for QueryParamsResponse { } /// QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC /// method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySigningInfoRequest { @@ -176,6 +185,7 @@ impl ::prost::Name for QuerySigningInfoRequest { } /// QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC /// method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySigningInfoResponse { @@ -192,6 +202,7 @@ impl ::prost::Name for QuerySigningInfoResponse { } /// QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC /// method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySigningInfosRequest { @@ -207,6 +218,7 @@ impl ::prost::Name for QuerySigningInfosRequest { } /// QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC /// method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySigningInfosResponse { @@ -224,6 +236,7 @@ impl ::prost::Name for QuerySigningInfosResponse { } } /// MsgUnjail defines the Msg/Unjail request type +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUnjail { @@ -238,6 +251,7 @@ impl ::prost::Name for MsgUnjail { } } /// MsgUnjailResponse defines the Msg/Unjail response type +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUnjailResponse {} @@ -251,6 +265,7 @@ impl ::prost::Name for MsgUnjailResponse { /// MsgUpdateParams is the Msg/UpdateParams request type. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -274,6 +289,7 @@ impl ::prost::Name for MsgUpdateParams { /// MsgUpdateParams message. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} @@ -1037,6 +1053,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x20, 0x30, 0x2e, 0x34, 0x37, 0x0a, 0x0a, 0x0a, 0x0a, 0x03, 0x04, 0x03, 0x01, 0x12, 0x03, 0x43, 0x08, 0x1f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.slashing.v1beta1.serde.rs"); include!("cosmos.slashing.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.slashing.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.slashing.v1beta1.serde.rs deleted file mode 100644 index d22e65e..0000000 --- a/packages/proto/src/gen/cosmos.slashing.v1beta1.serde.rs +++ /dev/null @@ -1,1860 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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("cosmos.slashing.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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 cosmos.slashing.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( - "cosmos.slashing.v1beta1.MsgUpdateParams", - FIELDS, - GeneratedVisitor, - ) - } -} -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("cosmos.slashing.v1beta1.MsgUpdateParamsResponse", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 cosmos.slashing.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( - "cosmos.slashing.v1beta1.MsgUpdateParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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 { - struct_ser.serialize_field( - "signedBlocksWindow", - ToString::to_string(&self.signed_blocks_window).as_str(), - )?; - } - if !self.min_signed_per_window.is_empty() { - 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() { - struct_ser.serialize_field( - "slashFractionDoubleSign", - pbjson::private::base64::encode(&self.slash_fraction_double_sign).as_str(), - )?; - } - if !self.slash_fraction_downtime.is_empty() { - struct_ser.serialize_field( - "slashFractionDowntime", - pbjson::private::base64::encode(&self.slash_fraction_downtime).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Params { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field( - "startHeight", - ToString::to_string(&self.start_height).as_str(), - )?; - } - if self.index_offset != 0 { - 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 { - struct_ser.serialize_field( - "missedBlocksCounter", - ToString::to_string(&self.missed_blocks_counter).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ValidatorSigningInfo { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.staking.module.v1.rs b/packages/proto/src/gen/cosmos.staking.module.v1.rs index 0a564be..4463c9a 100644 --- a/packages/proto/src/gen/cosmos.staking.module.v1.rs +++ b/packages/proto/src/gen/cosmos.staking.module.v1.rs @@ -1,5 +1,6 @@ // @generated /// Module is the config object of the staking module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module { @@ -77,5 +78,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x12, 0x03, 0x12, 0x09, 0x12, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x01, 0x03, 0x12, 0x03, 0x12, 0x15, 0x16, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.staking.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.staking.module.v1.serde.rs b/packages/proto/src/gen/cosmos.staking.module.v1.serde.rs deleted file mode 100644 index bc0082f..0000000 --- a/packages/proto/src/gen/cosmos.staking.module.v1.serde.rs +++ /dev/null @@ -1,109 +0,0 @@ -// @generated -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.hooks_order.is_empty() { - len += 1; - } - if !self.authority.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.staking.module.v1.Module", len)?; - if !self.hooks_order.is_empty() { - struct_ser.serialize_field("hooksOrder", &self.hooks_order)?; - } - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Module { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["hooks_order", "hooksOrder", "authority"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - HooksOrder, - Authority, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "hooksOrder" | "hooks_order" => Ok(GeneratedField::HooksOrder), - "authority" => Ok(GeneratedField::Authority), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Module; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.staking.module.v1.Module") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut hooks_order__ = None; - let mut authority__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::HooksOrder => { - if hooks_order__.is_some() { - return Err(serde::de::Error::duplicate_field("hooksOrder")); - } - hooks_order__ = Some(map.next_value()?); - } - GeneratedField::Authority => { - if authority__.is_some() { - return Err(serde::de::Error::duplicate_field("authority")); - } - authority__ = Some(map.next_value()?); - } - } - } - Ok(Module { - hooks_order: hooks_order__.unwrap_or_default(), - authority: authority__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.staking.module.v1.Module", FIELDS, GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/cosmos.staking.v1beta1.rs b/packages/proto/src/gen/cosmos.staking.v1beta1.rs index 2ee2e61..1eef13c 100644 --- a/packages/proto/src/gen/cosmos.staking.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.staking.v1beta1.rs @@ -2,6 +2,7 @@ /// StakeAuthorization defines authorization for delegate/undelegate/redelegate. /// /// Since: cosmos-sdk 0.43 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StakeAuthorization { @@ -19,6 +20,7 @@ pub struct StakeAuthorization { /// Nested message and enum types in `StakeAuthorization`. pub mod stake_authorization { /// Validators defines list of validator addresses. + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Validators { @@ -33,6 +35,7 @@ pub mod stake_authorization { } } /// validators is the oneof that represents either allow_list or deny_list + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Policy { @@ -55,7 +58,19 @@ impl ::prost::Name for StakeAuthorization { /// AuthorizationType defines the type of staking module authorization type /// /// Since: cosmos-sdk 0.43 -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum AuthorizationType { /// AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type @@ -95,6 +110,7 @@ impl AuthorizationType { /// 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). +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HistoricalInfo { @@ -112,6 +128,7 @@ impl ::prost::Name for HistoricalInfo { } /// CommissionRates defines the initial commission rates to be used for creating /// a validator. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommissionRates { @@ -133,6 +150,7 @@ impl ::prost::Name for CommissionRates { } } /// Commission defines commission parameters for a given validator. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Commission { @@ -151,6 +169,7 @@ impl ::prost::Name for Commission { } } /// Description defines a validator description. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Description { @@ -185,6 +204,7 @@ impl ::prost::Name for 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Validator { @@ -238,6 +258,7 @@ impl ::prost::Name for Validator { } } /// ValAddresses defines a repeated set of validator addresses. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValAddresses { @@ -254,6 +275,7 @@ impl ::prost::Name for 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DvPair { @@ -270,6 +292,7 @@ impl ::prost::Name for DvPair { } } /// DVPairs defines an array of DVPair objects. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DvPairs { @@ -287,6 +310,7 @@ impl ::prost::Name for 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DvvTriplet { @@ -305,6 +329,7 @@ impl ::prost::Name for DvvTriplet { } } /// DVVTriplets defines an array of DVVTriplet objects. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DvvTriplets { @@ -321,6 +346,7 @@ impl ::prost::Name for 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Delegation { @@ -343,6 +369,7 @@ impl ::prost::Name for Delegation { } /// UnbondingDelegation stores all of a single delegator's unbonding bonds /// for a single validator in an time-ordered list. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UnbondingDelegation { @@ -366,6 +393,7 @@ impl ::prost::Name for UnbondingDelegation { } } /// UnbondingDelegationEntry defines an unbonding object with relevant metadata. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UnbondingDelegationEntry { @@ -396,6 +424,7 @@ impl ::prost::Name for UnbondingDelegationEntry { } } /// RedelegationEntry defines a redelegation object with relevant metadata. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RedelegationEntry { @@ -427,6 +456,7 @@ impl ::prost::Name for RedelegationEntry { } /// Redelegation contains the list of a particular delegator's redelegating bonds /// from a particular source validator to a particular destination validator. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Redelegation { @@ -453,6 +483,7 @@ impl ::prost::Name for Redelegation { } } /// Params defines the parameters for the x/staking module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -484,6 +515,7 @@ impl ::prost::Name for Params { } /// DelegationResponse is equivalent to Delegation except that it contains a /// balance in addition to shares which is more suitable for client responses. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelegationResponse { @@ -502,6 +534,7 @@ impl ::prost::Name for DelegationResponse { /// RedelegationEntryResponse is equivalent to a RedelegationEntry except that it /// contains a balance in addition to shares which is more suitable for client /// responses. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RedelegationEntryResponse { @@ -520,6 +553,7 @@ impl ::prost::Name for 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RedelegationResponse { @@ -537,6 +571,7 @@ impl ::prost::Name for RedelegationResponse { } /// Pool is used for tracking bonded and not-bonded token supply of the bond /// denomination. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Pool { @@ -554,6 +589,7 @@ impl ::prost::Name for Pool { } /// ValidatorUpdates defines an array of abci.ValidatorUpdate objects. /// TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorUpdates { @@ -568,7 +604,19 @@ impl ::prost::Name for ValidatorUpdates { } } /// BondStatus is the status of a validator. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum BondStatus { /// UNSPECIFIED defines an invalid validator status. @@ -605,7 +653,19 @@ impl BondStatus { } } /// Infraction indicates the infraction a validator commited. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum Infraction { /// UNSPECIFIED defines an empty infraction. @@ -638,6 +698,7 @@ impl Infraction { } } /// GenesisState defines the staking module's genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -675,6 +736,7 @@ impl ::prost::Name for GenesisState { } } /// LastValidatorPower required for validator set update logic. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LastValidatorPower { @@ -693,6 +755,7 @@ impl ::prost::Name for LastValidatorPower { } } /// QueryValidatorsRequest is request type for Query/Validators RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorsRequest { @@ -711,6 +774,7 @@ impl ::prost::Name for QueryValidatorsRequest { } } /// QueryValidatorsResponse is response type for the Query/Validators RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorsResponse { @@ -729,6 +793,7 @@ impl ::prost::Name for QueryValidatorsResponse { } } /// QueryValidatorRequest is response type for the Query/Validator RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorRequest { @@ -744,6 +809,7 @@ impl ::prost::Name for QueryValidatorRequest { } } /// QueryValidatorResponse is response type for the Query/Validator RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorResponse { @@ -760,6 +826,7 @@ impl ::prost::Name for QueryValidatorResponse { } /// QueryValidatorDelegationsRequest is request type for the /// Query/ValidatorDelegations RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorDelegationsRequest { @@ -779,6 +846,7 @@ impl ::prost::Name for QueryValidatorDelegationsRequest { } /// QueryValidatorDelegationsResponse is response type for the /// Query/ValidatorDelegations RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorDelegationsResponse { @@ -797,6 +865,7 @@ impl ::prost::Name for QueryValidatorDelegationsResponse { } /// QueryValidatorUnbondingDelegationsRequest is required type for the /// Query/ValidatorUnbondingDelegations RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorUnbondingDelegationsRequest { @@ -816,6 +885,7 @@ impl ::prost::Name for QueryValidatorUnbondingDelegationsRequest { } /// QueryValidatorUnbondingDelegationsResponse is response type for the /// Query/ValidatorUnbondingDelegations RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorUnbondingDelegationsResponse { @@ -833,6 +903,7 @@ impl ::prost::Name for QueryValidatorUnbondingDelegationsResponse { } } /// QueryDelegationRequest is request type for the Query/Delegation RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegationRequest { @@ -851,6 +922,7 @@ impl ::prost::Name for QueryDelegationRequest { } } /// QueryDelegationResponse is response type for the Query/Delegation RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegationResponse { @@ -867,6 +939,7 @@ impl ::prost::Name for QueryDelegationResponse { } /// QueryUnbondingDelegationRequest is request type for the /// Query/UnbondingDelegation RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUnbondingDelegationRequest { @@ -886,6 +959,7 @@ impl ::prost::Name for QueryUnbondingDelegationRequest { } /// QueryDelegationResponse is response type for the Query/UnbondingDelegation /// RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUnbondingDelegationResponse { @@ -902,6 +976,7 @@ impl ::prost::Name for QueryUnbondingDelegationResponse { } /// QueryDelegatorDelegationsRequest is request type for the /// Query/DelegatorDelegations RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorDelegationsRequest { @@ -921,6 +996,7 @@ impl ::prost::Name for QueryDelegatorDelegationsRequest { } /// QueryDelegatorDelegationsResponse is response type for the /// Query/DelegatorDelegations RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorDelegationsResponse { @@ -940,6 +1016,7 @@ impl ::prost::Name for QueryDelegatorDelegationsResponse { } /// QueryDelegatorUnbondingDelegationsRequest is request type for the /// Query/DelegatorUnbondingDelegations RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorUnbondingDelegationsRequest { @@ -959,6 +1036,7 @@ impl ::prost::Name for QueryDelegatorUnbondingDelegationsRequest { } /// QueryUnbondingDelegatorDelegationsResponse is response type for the /// Query/UnbondingDelegatorDelegations RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorUnbondingDelegationsResponse { @@ -977,6 +1055,7 @@ impl ::prost::Name for QueryDelegatorUnbondingDelegationsResponse { } /// QueryRedelegationsRequest is request type for the Query/Redelegations RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryRedelegationsRequest { @@ -1002,6 +1081,7 @@ impl ::prost::Name for QueryRedelegationsRequest { } /// QueryRedelegationsResponse is response type for the Query/Redelegations RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryRedelegationsResponse { @@ -1020,6 +1100,7 @@ impl ::prost::Name for QueryRedelegationsResponse { } /// QueryDelegatorValidatorsRequest is request type for the /// Query/DelegatorValidators RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorValidatorsRequest { @@ -1039,6 +1120,7 @@ impl ::prost::Name for QueryDelegatorValidatorsRequest { } /// QueryDelegatorValidatorsResponse is response type for the /// Query/DelegatorValidators RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorValidatorsResponse { @@ -1058,6 +1140,7 @@ impl ::prost::Name for QueryDelegatorValidatorsResponse { } /// QueryDelegatorValidatorRequest is request type for the /// Query/DelegatorValidator RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorValidatorRequest { @@ -1077,6 +1160,7 @@ impl ::prost::Name for QueryDelegatorValidatorRequest { } /// QueryDelegatorValidatorResponse response type for the /// Query/DelegatorValidator RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorValidatorResponse { @@ -1093,6 +1177,7 @@ impl ::prost::Name for QueryDelegatorValidatorResponse { } /// QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryHistoricalInfoRequest { @@ -1109,6 +1194,7 @@ impl ::prost::Name for QueryHistoricalInfoRequest { } /// QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryHistoricalInfoResponse { @@ -1124,6 +1210,7 @@ impl ::prost::Name for QueryHistoricalInfoResponse { } } /// QueryPoolRequest is request type for the Query/Pool RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPoolRequest {} @@ -1135,6 +1222,7 @@ impl ::prost::Name for QueryPoolRequest { } } /// QueryPoolResponse is response type for the Query/Pool RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPoolResponse { @@ -1150,6 +1238,7 @@ impl ::prost::Name for QueryPoolResponse { } } /// QueryParamsRequest is request type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} @@ -1161,6 +1250,7 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse is response type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -1176,6 +1266,7 @@ impl ::prost::Name for QueryParamsResponse { } } /// MsgCreateValidator defines a SDK message for creating a new validator. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateValidator { @@ -1202,6 +1293,7 @@ impl ::prost::Name for MsgCreateValidator { } } /// MsgCreateValidatorResponse defines the Msg/CreateValidator response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateValidatorResponse {} @@ -1213,6 +1305,7 @@ impl ::prost::Name for MsgCreateValidatorResponse { } } /// MsgEditValidator defines a SDK message for editing an existing validator. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgEditValidator { @@ -1237,6 +1330,7 @@ impl ::prost::Name for MsgEditValidator { } } /// MsgEditValidatorResponse defines the Msg/EditValidator response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgEditValidatorResponse {} @@ -1249,6 +1343,7 @@ impl ::prost::Name for MsgEditValidatorResponse { } /// MsgDelegate defines a SDK message for performing a delegation of coins /// from a delegator to a validator. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDelegate { @@ -1267,6 +1362,7 @@ impl ::prost::Name for MsgDelegate { } } /// MsgDelegateResponse defines the Msg/Delegate response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDelegateResponse {} @@ -1279,6 +1375,7 @@ impl ::prost::Name for MsgDelegateResponse { } /// MsgBeginRedelegate defines a SDK message for performing a redelegation /// of coins from a delegator and source validator to a destination validator. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgBeginRedelegate { @@ -1299,6 +1396,7 @@ impl ::prost::Name for MsgBeginRedelegate { } } /// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgBeginRedelegateResponse { @@ -1314,6 +1412,7 @@ impl ::prost::Name for MsgBeginRedelegateResponse { } /// MsgUndelegate defines a SDK message for performing an undelegation from a /// delegate and a validator. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUndelegate { @@ -1332,6 +1431,7 @@ impl ::prost::Name for MsgUndelegate { } } /// MsgUndelegateResponse defines the Msg/Undelegate response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUndelegateResponse { @@ -1348,6 +1448,7 @@ impl ::prost::Name for MsgUndelegateResponse { /// MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelUnbondingDelegation { @@ -1372,6 +1473,7 @@ impl ::prost::Name for MsgCancelUnbondingDelegation { /// MsgCancelUnbondingDelegationResponse /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelUnbondingDelegationResponse {} @@ -1385,6 +1487,7 @@ impl ::prost::Name for MsgCancelUnbondingDelegationResponse { /// MsgUpdateParams is the Msg/UpdateParams request type. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -1408,6 +1511,7 @@ impl ::prost::Name for MsgUpdateParams { /// MsgUpdateParams message. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} @@ -5257,6 +5361,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x30, 0x2e, 0x34, 0x37, 0x0a, 0x0a, 0x0b, 0x0a, 0x03, 0x04, 0x0d, 0x01, 0x12, 0x04, 0xc8, 0x01, 0x08, 0x1f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.staking.v1beta1.serde.rs"); include!("cosmos.staking.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.staking.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.staking.v1beta1.serde.rs deleted file mode 100644 index 9328bb1..0000000 --- a/packages/proto/src/gen/cosmos.staking.v1beta1.serde.rs +++ /dev/null @@ -1,8755 +0,0 @@ -// @generated -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) - } -} -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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(AuthorizationType::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(AuthorizationType::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> 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) - } -} -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) - } -} -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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(BondStatus::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(BondStatus::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> 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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -impl serde::Serialize for Infraction { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Unspecified => "INFRACTION_UNSPECIFIED", - Self::DoubleSign => "INFRACTION_DOUBLE_SIGN", - Self::Downtime => "INFRACTION_DOWNTIME", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for Infraction { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "INFRACTION_UNSPECIFIED", - "INFRACTION_DOUBLE_SIGN", - "INFRACTION_DOWNTIME", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Infraction; - - fn expecting(&self, formatter: &mut 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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(Infraction::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(Infraction::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "INFRACTION_UNSPECIFIED" => Ok(Infraction::Unspecified), - "INFRACTION_DOUBLE_SIGN" => Ok(Infraction::DoubleSign), - "INFRACTION_DOWNTIME" => Ok(Infraction::Downtime), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for LastValidatorPower { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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 { - struct_ser.serialize_field("power", ToString::to_string(&self.power).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field( - "creationHeight", - ToString::to_string(&self.creation_height).as_str(), - )?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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("cosmos.staking.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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 cosmos.staking.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( - "cosmos.staking.v1beta1.MsgUpdateParams", - FIELDS, - GeneratedVisitor, - ) - } -} -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("cosmos.staking.v1beta1.MsgUpdateParamsResponse", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 cosmos.staking.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( - "cosmos.staking.v1beta1.MsgUpdateParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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; - } - if self.unbonding_id != 0 { - len += 1; - } - if self.unbonding_on_hold_ref_count != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.staking.v1beta1.RedelegationEntry", len)?; - if self.creation_height != 0 { - 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)?; - } - if self.unbonding_id != 0 { - struct_ser.serialize_field( - "unbondingId", - ToString::to_string(&self.unbonding_id).as_str(), - )?; - } - if self.unbonding_on_hold_ref_count != 0 { - struct_ser.serialize_field( - "unbondingOnHoldRefCount", - ToString::to_string(&self.unbonding_on_hold_ref_count).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for RedelegationEntry { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "creation_height", - "creationHeight", - "completion_time", - "completionTime", - "initial_balance", - "initialBalance", - "shares_dst", - "sharesDst", - "unbonding_id", - "unbondingId", - "unbonding_on_hold_ref_count", - "unbondingOnHoldRefCount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - CreationHeight, - CompletionTime, - InitialBalance, - SharesDst, - UnbondingId, - UnbondingOnHoldRefCount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "unbondingId" | "unbonding_id" => Ok(GeneratedField::UnbondingId), - "unbondingOnHoldRefCount" | "unbonding_on_hold_ref_count" => { - Ok(GeneratedField::UnbondingOnHoldRefCount) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RedelegationEntry; - - fn expecting(&self, formatter: &mut 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; - let mut unbonding_id__ = None; - let mut unbonding_on_hold_ref_count__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::CreationHeight => { - if creation_height__.is_some() { - return Err(serde::de::Error::duplicate_field("creationHeight")); - } - creation_height__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::CompletionTime => { - if completion_time__.is_some() { - return Err(serde::de::Error::duplicate_field("completionTime")); - } - completion_time__ = map.next_value()?; - } - GeneratedField::InitialBalance => { - if initial_balance__.is_some() { - return Err(serde::de::Error::duplicate_field("initialBalance")); - } - initial_balance__ = Some(map.next_value()?); - } - GeneratedField::SharesDst => { - if shares_dst__.is_some() { - return Err(serde::de::Error::duplicate_field("sharesDst")); - } - shares_dst__ = Some(map.next_value()?); - } - GeneratedField::UnbondingId => { - if unbonding_id__.is_some() { - return Err(serde::de::Error::duplicate_field("unbondingId")); - } - unbonding_id__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::UnbondingOnHoldRefCount => { - if unbonding_on_hold_ref_count__.is_some() { - return Err(serde::de::Error::duplicate_field( - "unbondingOnHoldRefCount", - )); - } - unbonding_on_hold_ref_count__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(RedelegationEntry { - creation_height: creation_height__.unwrap_or_default(), - completion_time: completion_time__, - initial_balance: initial_balance__.unwrap_or_default(), - shares_dst: shares_dst__.unwrap_or_default(), - unbonding_id: unbonding_id__.unwrap_or_default(), - unbonding_on_hold_ref_count: unbonding_on_hold_ref_count__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.staking.v1beta1.RedelegationEntry", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for RedelegationEntryResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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::from_i32(self.authorization_type).ok_or_else(|| { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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; - } - if self.unbonding_id != 0 { - len += 1; - } - if self.unbonding_on_hold_ref_count != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.staking.v1beta1.UnbondingDelegationEntry", len)?; - if self.creation_height != 0 { - 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)?; - } - if self.unbonding_id != 0 { - struct_ser.serialize_field( - "unbondingId", - ToString::to_string(&self.unbonding_id).as_str(), - )?; - } - if self.unbonding_on_hold_ref_count != 0 { - struct_ser.serialize_field( - "unbondingOnHoldRefCount", - ToString::to_string(&self.unbonding_on_hold_ref_count).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for UnbondingDelegationEntry { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "creation_height", - "creationHeight", - "completion_time", - "completionTime", - "initial_balance", - "initialBalance", - "balance", - "unbonding_id", - "unbondingId", - "unbonding_on_hold_ref_count", - "unbondingOnHoldRefCount", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - CreationHeight, - CompletionTime, - InitialBalance, - Balance, - UnbondingId, - UnbondingOnHoldRefCount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "unbondingId" | "unbonding_id" => Ok(GeneratedField::UnbondingId), - "unbondingOnHoldRefCount" | "unbonding_on_hold_ref_count" => { - Ok(GeneratedField::UnbondingOnHoldRefCount) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = UnbondingDelegationEntry; - - fn expecting(&self, formatter: &mut 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; - let mut unbonding_id__ = None; - let mut unbonding_on_hold_ref_count__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::CreationHeight => { - if creation_height__.is_some() { - return Err(serde::de::Error::duplicate_field("creationHeight")); - } - creation_height__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::CompletionTime => { - if completion_time__.is_some() { - return Err(serde::de::Error::duplicate_field("completionTime")); - } - completion_time__ = map.next_value()?; - } - GeneratedField::InitialBalance => { - if initial_balance__.is_some() { - return Err(serde::de::Error::duplicate_field("initialBalance")); - } - initial_balance__ = Some(map.next_value()?); - } - GeneratedField::Balance => { - if balance__.is_some() { - return Err(serde::de::Error::duplicate_field("balance")); - } - balance__ = Some(map.next_value()?); - } - GeneratedField::UnbondingId => { - if unbonding_id__.is_some() { - return Err(serde::de::Error::duplicate_field("unbondingId")); - } - unbonding_id__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::UnbondingOnHoldRefCount => { - if unbonding_on_hold_ref_count__.is_some() { - return Err(serde::de::Error::duplicate_field( - "unbondingOnHoldRefCount", - )); - } - unbonding_on_hold_ref_count__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(UnbondingDelegationEntry { - creation_height: creation_height__.unwrap_or_default(), - completion_time: completion_time__, - initial_balance: initial_balance__.unwrap_or_default(), - balance: balance__.unwrap_or_default(), - unbonding_id: unbonding_id__.unwrap_or_default(), - unbonding_on_hold_ref_count: unbonding_on_hold_ref_count__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.staking.v1beta1.UnbondingDelegationEntry", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ValAddresses { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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; - } - if self.unbonding_on_hold_ref_count != 0 { - len += 1; - } - if !self.unbonding_ids.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::from_i32(self.status).ok_or_else(|| { - 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 { - 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)?; - } - if self.unbonding_on_hold_ref_count != 0 { - struct_ser.serialize_field( - "unbondingOnHoldRefCount", - ToString::to_string(&self.unbonding_on_hold_ref_count).as_str(), - )?; - } - if !self.unbonding_ids.is_empty() { - struct_ser.serialize_field( - "unbondingIds", - &self - .unbonding_ids - .iter() - .map(ToString::to_string) - .collect::>(), - )?; - } - struct_ser.end() - } -} -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", - "unbonding_on_hold_ref_count", - "unbondingOnHoldRefCount", - "unbonding_ids", - "unbondingIds", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - OperatorAddress, - ConsensusPubkey, - Jailed, - Status, - Tokens, - DelegatorShares, - Description, - UnbondingHeight, - UnbondingTime, - Commission, - MinSelfDelegation, - UnbondingOnHoldRefCount, - UnbondingIds, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } - "unbondingOnHoldRefCount" | "unbonding_on_hold_ref_count" => { - Ok(GeneratedField::UnbondingOnHoldRefCount) - } - "unbondingIds" | "unbonding_ids" => Ok(GeneratedField::UnbondingIds), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Validator; - - fn expecting(&self, formatter: &mut 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; - let mut unbonding_on_hold_ref_count__ = None; - let mut unbonding_ids__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::OperatorAddress => { - if operator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("operatorAddress")); - } - operator_address__ = Some(map.next_value()?); - } - GeneratedField::ConsensusPubkey => { - if consensus_pubkey__.is_some() { - return Err(serde::de::Error::duplicate_field("consensusPubkey")); - } - consensus_pubkey__ = map.next_value()?; - } - GeneratedField::Jailed => { - if jailed__.is_some() { - return Err(serde::de::Error::duplicate_field("jailed")); - } - jailed__ = Some(map.next_value()?); - } - GeneratedField::Status => { - if status__.is_some() { - return Err(serde::de::Error::duplicate_field("status")); - } - status__ = Some(map.next_value::()? as i32); - } - GeneratedField::Tokens => { - if tokens__.is_some() { - return Err(serde::de::Error::duplicate_field("tokens")); - } - tokens__ = Some(map.next_value()?); - } - GeneratedField::DelegatorShares => { - if delegator_shares__.is_some() { - return Err(serde::de::Error::duplicate_field("delegatorShares")); - } - delegator_shares__ = Some(map.next_value()?); - } - GeneratedField::Description => { - if description__.is_some() { - return Err(serde::de::Error::duplicate_field("description")); - } - description__ = map.next_value()?; - } - GeneratedField::UnbondingHeight => { - if unbonding_height__.is_some() { - return Err(serde::de::Error::duplicate_field("unbondingHeight")); - } - unbonding_height__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::UnbondingTime => { - if unbonding_time__.is_some() { - return Err(serde::de::Error::duplicate_field("unbondingTime")); - } - unbonding_time__ = map.next_value()?; - } - GeneratedField::Commission => { - if commission__.is_some() { - return Err(serde::de::Error::duplicate_field("commission")); - } - commission__ = map.next_value()?; - } - GeneratedField::MinSelfDelegation => { - if min_self_delegation__.is_some() { - return Err(serde::de::Error::duplicate_field("minSelfDelegation")); - } - min_self_delegation__ = Some(map.next_value()?); - } - GeneratedField::UnbondingOnHoldRefCount => { - if unbonding_on_hold_ref_count__.is_some() { - return Err(serde::de::Error::duplicate_field( - "unbondingOnHoldRefCount", - )); - } - unbonding_on_hold_ref_count__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::UnbondingIds => { - if unbonding_ids__.is_some() { - return Err(serde::de::Error::duplicate_field("unbondingIds")); - } - unbonding_ids__ = Some( - map.next_value::>>()? - .into_iter() - .map(|x| x.0) - .collect(), - ); - } - } - } - Ok(Validator { - operator_address: operator_address__.unwrap_or_default(), - consensus_pubkey: consensus_pubkey__, - jailed: jailed__.unwrap_or_default(), - status: status__.unwrap_or_default(), - tokens: tokens__.unwrap_or_default(), - delegator_shares: delegator_shares__.unwrap_or_default(), - description: description__, - unbonding_height: unbonding_height__.unwrap_or_default(), - unbonding_time: unbonding_time__, - commission: commission__, - min_self_delegation: min_self_delegation__.unwrap_or_default(), - unbonding_on_hold_ref_count: unbonding_on_hold_ref_count__.unwrap_or_default(), - unbonding_ids: unbonding_ids__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.staking.v1beta1.Validator", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ValidatorUpdates { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.updates.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.staking.v1beta1.ValidatorUpdates", len)?; - if !self.updates.is_empty() { - struct_ser.serialize_field("updates", &self.updates)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ValidatorUpdates { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["updates"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Updates, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "updates" => Ok(GeneratedField::Updates), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ValidatorUpdates; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.staking.v1beta1.ValidatorUpdates") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut updates__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Updates => { - if updates__.is_some() { - return Err(serde::de::Error::duplicate_field("updates")); - } - updates__ = Some(map.next_value()?); - } - } - } - Ok(ValidatorUpdates { - updates: updates__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.staking.v1beta1.ValidatorUpdates", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/cosmos.tx.config.v1.rs b/packages/proto/src/gen/cosmos.tx.config.v1.rs index e754b95..bfbaac7 100644 --- a/packages/proto/src/gen/cosmos.tx.config.v1.rs +++ b/packages/proto/src/gen/cosmos.tx.config.v1.rs @@ -1,5 +1,6 @@ // @generated /// Config is the config object of the x/auth/tx package. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Config { @@ -75,5 +76,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x12, 0x07, 0x18, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x01, 0x03, 0x12, 0x03, 0x12, 0x1b, 0x1c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.tx.config.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.tx.config.v1.serde.rs b/packages/proto/src/gen/cosmos.tx.config.v1.serde.rs deleted file mode 100644 index 1b3acda..0000000 --- a/packages/proto/src/gen/cosmos.tx.config.v1.serde.rs +++ /dev/null @@ -1,118 +0,0 @@ -// @generated -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.skip_ante_handler { - len += 1; - } - if self.skip_post_handler { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.tx.config.v1.Config", len)?; - if self.skip_ante_handler { - struct_ser.serialize_field("skipAnteHandler", &self.skip_ante_handler)?; - } - if self.skip_post_handler { - struct_ser.serialize_field("skipPostHandler", &self.skip_post_handler)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Config { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "skip_ante_handler", - "skipAnteHandler", - "skip_post_handler", - "skipPostHandler", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SkipAnteHandler, - SkipPostHandler, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "skipAnteHandler" | "skip_ante_handler" => { - Ok(GeneratedField::SkipAnteHandler) - } - "skipPostHandler" | "skip_post_handler" => { - Ok(GeneratedField::SkipPostHandler) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Config; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.tx.config.v1.Config") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut skip_ante_handler__ = None; - let mut skip_post_handler__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::SkipAnteHandler => { - if skip_ante_handler__.is_some() { - return Err(serde::de::Error::duplicate_field("skipAnteHandler")); - } - skip_ante_handler__ = Some(map.next_value()?); - } - GeneratedField::SkipPostHandler => { - if skip_post_handler__.is_some() { - return Err(serde::de::Error::duplicate_field("skipPostHandler")); - } - skip_post_handler__ = Some(map.next_value()?); - } - } - } - Ok(Config { - skip_ante_handler: skip_ante_handler__.unwrap_or_default(), - skip_post_handler: skip_post_handler__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.tx.config.v1.Config", FIELDS, GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/cosmos.tx.signing.v1beta1.rs b/packages/proto/src/gen/cosmos.tx.signing.v1beta1.rs index 692d46c..91bfcb5 100644 --- a/packages/proto/src/gen/cosmos.tx.signing.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.tx.signing.v1beta1.rs @@ -1,5 +1,6 @@ // @generated /// SignatureDescriptors wraps multiple SignatureDescriptor's. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SignatureDescriptors { @@ -18,6 +19,7 @@ impl ::prost::Name for 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SignatureDescriptor { @@ -35,6 +37,7 @@ pub struct SignatureDescriptor { /// Nested message and enum types in `SignatureDescriptor`. pub mod signature_descriptor { /// Data represents signature data + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Data { @@ -45,6 +48,7 @@ pub mod signature_descriptor { /// Nested message and enum types in `Data`. pub mod data { /// Single is the signature data for a single signer + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Single { @@ -66,6 +70,7 @@ pub mod signature_descriptor { } } /// Multi is the signature data for a multisig public key + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Multi { @@ -89,6 +94,7 @@ pub mod signature_descriptor { } } /// sum is the oneof that specifies whether this represents single or multi-signature data + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Sum { @@ -126,7 +132,19 @@ impl ::prost::Name for SignatureDescriptor { /// encouraged to open a small PR against this file to add a new case /// to this SignMode enum describing their sign mode so that different /// apps have a consistent version of this enum. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum SignMode { /// SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be @@ -511,5 +529,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x01, 0x03, 0x00, 0x03, 0x01, 0x02, 0x01, 0x03, 0x12, 0x03, 0x66, 0x21, 0x22, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.tx.signing.v1beta1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.tx.signing.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.tx.signing.v1beta1.serde.rs deleted file mode 100644 index ea3d0f4..0000000 --- a/packages/proto/src/gen/cosmos.tx.signing.v1beta1.serde.rs +++ /dev/null @@ -1,679 +0,0 @@ -// @generated -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) - } -} -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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(SignMode::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(SignMode::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> 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) - } -} -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 { - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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::from_i32(self.mode).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.mode)) - })?; - struct_ser.serialize_field("mode", &v)?; - } - if !self.signature.is_empty() { - struct_ser.serialize_field( - "signature", - pbjson::private::base64::encode(&self.signature).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for signature_descriptor::data::Single { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["mode", "signature"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Mode, - Signature, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.tx.v1beta1.rs b/packages/proto/src/gen/cosmos.tx.v1beta1.rs index 8d982e5..6da03c9 100644 --- a/packages/proto/src/gen/cosmos.tx.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.tx.v1beta1.rs @@ -1,5 +1,6 @@ // @generated /// Tx is the standard type used for broadcasting transactions. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Tx { @@ -28,6 +29,7 @@ impl ::prost::Name for 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxRaw { @@ -53,6 +55,7 @@ impl ::prost::Name for TxRaw { } } /// SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SignDoc { @@ -84,6 +87,7 @@ impl ::prost::Name for SignDoc { /// SIGN_MODE_DIRECT_AUX. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SignDocDirectAux { @@ -122,6 +126,7 @@ impl ::prost::Name for SignDocDirectAux { } } /// TxBody is the body of a transaction that all signers sign over. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxBody { @@ -163,6 +168,7 @@ impl ::prost::Name for TxBody { } /// AuthInfo describes the fee and signer modes that are used to sign a /// transaction. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AuthInfo { @@ -196,6 +202,7 @@ impl ::prost::Name for AuthInfo { } /// SignerInfo describes the public key and signing mode of a single top-level /// signer. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SignerInfo { @@ -222,6 +229,7 @@ impl ::prost::Name for SignerInfo { } } /// ModeInfo describes the signing mode of a single or nested multisig signer. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModeInfo { @@ -235,6 +243,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 + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Single { @@ -250,6 +259,7 @@ pub mod mode_info { } } /// Multi is the mode info for a multisig public key + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Multi { @@ -271,6 +281,7 @@ pub mod mode_info { } /// sum is the oneof that specifies whether this represents a single or nested /// multisig signer + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Sum { @@ -292,6 +303,7 @@ impl ::prost::Name for ModeInfo { /// 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Fee { @@ -323,6 +335,7 @@ impl ::prost::Name for Fee { /// Tip is the tip used for meta-transactions. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Tip { @@ -346,6 +359,7 @@ impl ::prost::Name for Tip { /// by the node if sent directly as-is. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AuxSignerData { @@ -375,6 +389,7 @@ impl ::prost::Name for AuxSignerData { } /// GetTxsEventRequest is the request type for the Service.TxsByEvents /// RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetTxsEventRequest { @@ -405,6 +420,7 @@ impl ::prost::Name for GetTxsEventRequest { } /// GetTxsEventResponse is the response type for the Service.TxsByEvents /// RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetTxsEventResponse { @@ -432,6 +448,7 @@ impl ::prost::Name for GetTxsEventResponse { } /// BroadcastTxRequest is the request type for the Service.BroadcastTxRequest /// RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BroadcastTxRequest { @@ -450,6 +467,7 @@ impl ::prost::Name for BroadcastTxRequest { } /// BroadcastTxResponse is the response type for the /// Service.BroadcastTx method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BroadcastTxResponse { @@ -466,6 +484,7 @@ impl ::prost::Name for BroadcastTxResponse { } /// SimulateRequest is the request type for the Service.Simulate /// RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SimulateRequest { @@ -489,6 +508,7 @@ impl ::prost::Name for SimulateRequest { } /// SimulateResponse is the response type for the /// Service.SimulateRPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SimulateResponse { @@ -508,6 +528,7 @@ impl ::prost::Name for SimulateResponse { } /// GetTxRequest is the request type for the Service.GetTx /// RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetTxRequest { @@ -523,6 +544,7 @@ impl ::prost::Name for GetTxRequest { } } /// GetTxResponse is the response type for the Service.GetTx method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetTxResponse { @@ -544,6 +566,7 @@ impl ::prost::Name for GetTxResponse { /// RPC method. /// /// Since: cosmos-sdk 0.45.2 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetBlockWithTxsRequest { @@ -564,6 +587,7 @@ impl ::prost::Name for GetBlockWithTxsRequest { /// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. /// /// Since: cosmos-sdk 0.45.2 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetBlockWithTxsResponse { @@ -589,6 +613,7 @@ impl ::prost::Name for GetBlockWithTxsResponse { /// RPC method. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxDecodeRequest { @@ -607,6 +632,7 @@ impl ::prost::Name for TxDecodeRequest { /// Service.TxDecode method. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxDecodeResponse { @@ -625,6 +651,7 @@ impl ::prost::Name for TxDecodeResponse { /// RPC method. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxEncodeRequest { @@ -643,6 +670,7 @@ impl ::prost::Name for TxEncodeRequest { /// Service.TxEncode method. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxEncodeResponse { @@ -661,6 +689,7 @@ impl ::prost::Name for TxEncodeResponse { /// RPC method. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxEncodeAminoRequest { @@ -678,6 +707,7 @@ impl ::prost::Name for TxEncodeAminoRequest { /// RPC method. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxEncodeAminoResponse { @@ -695,6 +725,7 @@ impl ::prost::Name for TxEncodeAminoResponse { /// RPC method. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxDecodeAminoRequest { @@ -712,6 +743,7 @@ impl ::prost::Name for TxDecodeAminoRequest { /// RPC method. /// /// Since: cosmos-sdk 0.47 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxDecodeAminoResponse { @@ -726,7 +758,19 @@ impl ::prost::Name for TxDecodeAminoResponse { } } /// OrderBy defines the sorting order -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum OrderBy { /// ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. @@ -759,7 +803,19 @@ impl OrderBy { } } /// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum BroadcastMode { /// zero-value for mode ordering @@ -2401,6 +2457,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x02, 0x00, 0x01, 0x12, 0x04, 0x93, 0x02, 0x09, 0x13, 0x0a, 0x0d, 0x0a, 0x05, 0x04, 0x11, 0x02, 0x00, 0x03, 0x12, 0x04, 0x93, 0x02, 0x16, 0x17, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.tx.v1beta1.serde.rs"); include!("cosmos.tx.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.tx.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.tx.v1beta1.serde.rs deleted file mode 100644 index 52f8992..0000000 --- a/packages/proto/src/gen/cosmos.tx.v1beta1.serde.rs +++ /dev/null @@ -1,4022 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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::from_i32(self.mode).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.mode)) - })?; - struct_ser.serialize_field("mode", &v)?; - } - if !self.sig.is_empty() { - struct_ser - .serialize_field("sig", pbjson::private::base64::encode(&self.sig).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for AuxSignerData { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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) - } -} -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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(BroadcastMode::from_i32) - .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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(BroadcastMode::from_i32) - .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) - } -} -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() { - struct_ser.serialize_field( - "txBytes", - pbjson::private::base64::encode(&self.tx_bytes).as_str(), - )?; - } - if self.mode != 0 { - let v = BroadcastMode::from_i32(self.mode).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.mode)) - })?; - struct_ser.serialize_field("mode", &v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for BroadcastTxRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["tx_bytes", "txBytes", "mode"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - TxBytes, - Mode, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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::from_i32(self.order_by).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.order_by)) - })?; - struct_ser.serialize_field("orderBy", &v)?; - } - if self.page != 0 { - struct_ser.serialize_field("page", ToString::to_string(&self.page).as_str())?; - } - if self.limit != 0 { - struct_ser.serialize_field("limit", ToString::to_string(&self.limit).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field("total", ToString::to_string(&self.total).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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::from_i32(self.mode).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.mode)) - })?; - struct_ser.serialize_field("mode", &v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for mode_info::Single { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["mode"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Mode, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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) - } -} -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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(OrderBy::from_i32) - .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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(OrderBy::from_i32) - .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) - } -} -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() { - struct_ser.serialize_field( - "bodyBytes", - pbjson::private::base64::encode(&self.body_bytes).as_str(), - )?; - } - if !self.auth_info_bytes.is_empty() { - 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 { - struct_ser.serialize_field( - "accountNumber", - ToString::to_string(&self.account_number).as_str(), - )?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() { - 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 { - struct_ser.serialize_field( - "accountNumber", - ToString::to_string(&self.account_number).as_str(), - )?; - } - if self.sequence != 0 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() { - struct_ser.serialize_field( - "txBytes", - pbjson::private::base64::encode(&self.tx_bytes).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SimulateRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["tx", "tx_bytes", "txBytes"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Tx, - TxBytes, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -impl serde::Serialize for TxDecodeAminoRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.amino_binary.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.tx.v1beta1.TxDecodeAminoRequest", len)?; - if !self.amino_binary.is_empty() { - struct_ser.serialize_field( - "aminoBinary", - pbjson::private::base64::encode(&self.amino_binary).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TxDecodeAminoRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["amino_binary", "aminoBinary"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - AminoBinary, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "aminoBinary" | "amino_binary" => Ok(GeneratedField::AminoBinary), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TxDecodeAminoRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.tx.v1beta1.TxDecodeAminoRequest") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut amino_binary__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::AminoBinary => { - if amino_binary__.is_some() { - return Err(serde::de::Error::duplicate_field("aminoBinary")); - } - amino_binary__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - } - } - Ok(TxDecodeAminoRequest { - amino_binary: amino_binary__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.tx.v1beta1.TxDecodeAminoRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for TxDecodeAminoResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.amino_json.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.tx.v1beta1.TxDecodeAminoResponse", len)?; - if !self.amino_json.is_empty() { - struct_ser.serialize_field("aminoJson", &self.amino_json)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TxDecodeAminoResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["amino_json", "aminoJson"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - AminoJson, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "aminoJson" | "amino_json" => Ok(GeneratedField::AminoJson), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TxDecodeAminoResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.tx.v1beta1.TxDecodeAminoResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut amino_json__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::AminoJson => { - if amino_json__.is_some() { - return Err(serde::de::Error::duplicate_field("aminoJson")); - } - amino_json__ = Some(map.next_value()?); - } - } - } - Ok(TxDecodeAminoResponse { - amino_json: amino_json__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.tx.v1beta1.TxDecodeAminoResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for TxDecodeRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.tx_bytes.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.tx.v1beta1.TxDecodeRequest", len)?; - if !self.tx_bytes.is_empty() { - struct_ser.serialize_field( - "txBytes", - pbjson::private::base64::encode(&self.tx_bytes).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TxDecodeRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["tx_bytes", "txBytes"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - TxBytes, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TxDecodeRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.tx.v1beta1.TxDecodeRequest") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut tx_bytes__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::TxBytes => { - if tx_bytes__.is_some() { - return Err(serde::de::Error::duplicate_field("txBytes")); - } - tx_bytes__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - } - } - Ok(TxDecodeRequest { - tx_bytes: tx_bytes__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.tx.v1beta1.TxDecodeRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for TxDecodeResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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.tx.v1beta1.TxDecodeResponse", len)?; - if let Some(v) = self.tx.as_ref() { - struct_ser.serialize_field("tx", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TxDecodeResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["tx"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Tx, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = TxDecodeResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.tx.v1beta1.TxDecodeResponse") - } - - 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(TxDecodeResponse { tx: tx__ }) - } - } - deserializer.deserialize_struct( - "cosmos.tx.v1beta1.TxDecodeResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for TxEncodeAminoRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.amino_json.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.tx.v1beta1.TxEncodeAminoRequest", len)?; - if !self.amino_json.is_empty() { - struct_ser.serialize_field("aminoJson", &self.amino_json)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TxEncodeAminoRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["amino_json", "aminoJson"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - AminoJson, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "aminoJson" | "amino_json" => Ok(GeneratedField::AminoJson), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TxEncodeAminoRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.tx.v1beta1.TxEncodeAminoRequest") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut amino_json__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::AminoJson => { - if amino_json__.is_some() { - return Err(serde::de::Error::duplicate_field("aminoJson")); - } - amino_json__ = Some(map.next_value()?); - } - } - } - Ok(TxEncodeAminoRequest { - amino_json: amino_json__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.tx.v1beta1.TxEncodeAminoRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for TxEncodeAminoResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.amino_binary.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.tx.v1beta1.TxEncodeAminoResponse", len)?; - if !self.amino_binary.is_empty() { - struct_ser.serialize_field( - "aminoBinary", - pbjson::private::base64::encode(&self.amino_binary).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TxEncodeAminoResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["amino_binary", "aminoBinary"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - AminoBinary, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "aminoBinary" | "amino_binary" => Ok(GeneratedField::AminoBinary), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TxEncodeAminoResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.tx.v1beta1.TxEncodeAminoResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut amino_binary__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::AminoBinary => { - if amino_binary__.is_some() { - return Err(serde::de::Error::duplicate_field("aminoBinary")); - } - amino_binary__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - } - } - Ok(TxEncodeAminoResponse { - amino_binary: amino_binary__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.tx.v1beta1.TxEncodeAminoResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for TxEncodeRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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.tx.v1beta1.TxEncodeRequest", len)?; - if let Some(v) = self.tx.as_ref() { - struct_ser.serialize_field("tx", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TxEncodeRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["tx"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Tx, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = TxEncodeRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.tx.v1beta1.TxEncodeRequest") - } - - 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(TxEncodeRequest { tx: tx__ }) - } - } - deserializer.deserialize_struct( - "cosmos.tx.v1beta1.TxEncodeRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for TxEncodeResponse { - #[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; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.tx.v1beta1.TxEncodeResponse", len)?; - if !self.tx_bytes.is_empty() { - struct_ser.serialize_field( - "txBytes", - pbjson::private::base64::encode(&self.tx_bytes).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TxEncodeResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["tx_bytes", "txBytes"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - TxBytes, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TxEncodeResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.tx.v1beta1.TxEncodeResponse") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut tx_bytes__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::TxBytes => { - if tx_bytes__.is_some() { - return Err(serde::de::Error::duplicate_field("txBytes")); - } - tx_bytes__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - } - } - Ok(TxEncodeResponse { - tx_bytes: tx_bytes__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.tx.v1beta1.TxEncodeResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for TxRaw { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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() { - struct_ser.serialize_field( - "bodyBytes", - pbjson::private::base64::encode(&self.body_bytes).as_str(), - )?; - } - if !self.auth_info_bytes.is_empty() { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.upgrade.module.v1.rs b/packages/proto/src/gen/cosmos.upgrade.module.v1.rs index d48c24f..364452b 100644 --- a/packages/proto/src/gen/cosmos.upgrade.module.v1.rs +++ b/packages/proto/src/gen/cosmos.upgrade.module.v1.rs @@ -1,5 +1,6 @@ // @generated /// Module is the config object of the upgrade module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module { @@ -52,5 +53,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x00, 0x03, 0x12, 0x03, 0x0d, 0x15, 0x16, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.upgrade.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.upgrade.module.v1.serde.rs b/packages/proto/src/gen/cosmos.upgrade.module.v1.serde.rs deleted file mode 100644 index c48719c..0000000 --- a/packages/proto/src/gen/cosmos.upgrade.module.v1.serde.rs +++ /dev/null @@ -1,93 +0,0 @@ -// @generated -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.authority.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.module.v1.Module", len)?; - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Module { - #[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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = Module; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.upgrade.module.v1.Module") - } - - 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(Module { - authority: authority__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.upgrade.module.v1.Module", FIELDS, GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/cosmos.upgrade.v1beta1.rs b/packages/proto/src/gen/cosmos.upgrade.v1beta1.rs index e8f6936..6d7e8e3 100644 --- a/packages/proto/src/gen/cosmos.upgrade.v1beta1.rs +++ b/packages/proto/src/gen/cosmos.upgrade.v1beta1.rs @@ -1,5 +1,6 @@ // @generated /// Plan specifies information about a planned upgrade and when it should occur. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Plan { @@ -43,6 +44,7 @@ impl ::prost::Name for Plan { /// upgrade. /// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov /// proposals, see MsgSoftwareUpgrade. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SoftwareUpgradeProposal { @@ -67,6 +69,7 @@ impl ::prost::Name for SoftwareUpgradeProposal { /// upgrade. /// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov /// proposals, see MsgCancelUpgrade. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CancelSoftwareUpgradeProposal { @@ -87,6 +90,7 @@ impl ::prost::Name for CancelSoftwareUpgradeProposal { /// ModuleVersion specifies a module and its consensus version. /// /// Since: cosmos-sdk 0.43 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleVersion { @@ -106,6 +110,7 @@ impl ::prost::Name for ModuleVersion { } /// QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCurrentPlanRequest {} @@ -118,6 +123,7 @@ impl ::prost::Name for QueryCurrentPlanRequest { } /// QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCurrentPlanResponse { @@ -134,6 +140,7 @@ impl ::prost::Name for QueryCurrentPlanResponse { } /// QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAppliedPlanRequest { @@ -150,6 +157,7 @@ impl ::prost::Name for QueryAppliedPlanRequest { } /// QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAppliedPlanResponse { @@ -166,6 +174,7 @@ impl ::prost::Name for QueryAppliedPlanResponse { } /// QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState /// RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradedConsensusStateRequest { @@ -183,6 +192,7 @@ impl ::prost::Name for QueryUpgradedConsensusStateRequest { } /// QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState /// RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradedConsensusStateResponse { @@ -201,6 +211,7 @@ impl ::prost::Name for QueryUpgradedConsensusStateResponse { /// RPC method. /// /// Since: cosmos-sdk 0.43 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleVersionsRequest { @@ -221,6 +232,7 @@ impl ::prost::Name for QueryModuleVersionsRequest { /// RPC method. /// /// Since: cosmos-sdk 0.43 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleVersionsResponse { @@ -238,6 +250,7 @@ impl ::prost::Name for QueryModuleVersionsResponse { /// QueryAuthorityRequest is the request type for Query/Authority /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAuthorityRequest {} @@ -251,6 +264,7 @@ impl ::prost::Name for QueryAuthorityRequest { /// QueryAuthorityResponse is the response type for Query/Authority /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAuthorityResponse { @@ -267,6 +281,7 @@ impl ::prost::Name for QueryAuthorityResponse { /// MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSoftwareUpgrade { @@ -287,6 +302,7 @@ impl ::prost::Name for MsgSoftwareUpgrade { /// MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSoftwareUpgradeResponse {} @@ -300,6 +316,7 @@ impl ::prost::Name for MsgSoftwareUpgradeResponse { /// MsgCancelUpgrade is the Msg/CancelUpgrade request type. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelUpgrade { @@ -317,6 +334,7 @@ impl ::prost::Name for MsgCancelUpgrade { /// MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelUpgradeResponse {} @@ -1089,6 +1107,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x34, 0x36, 0x0a, 0x0a, 0x0a, 0x0a, 0x03, 0x04, 0x03, 0x01, 0x12, 0x03, 0x3d, 0x08, 0x20, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.upgrade.v1beta1.serde.rs"); include!("cosmos.upgrade.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.upgrade.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.upgrade.v1beta1.serde.rs deleted file mode 100644 index 8bb5f78..0000000 --- a/packages/proto/src/gen/cosmos.upgrade.v1beta1.serde.rs +++ /dev/null @@ -1,1886 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field("version", ToString::to_string(&self.version).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field( - "lastHeight", - ToString::to_string(&self.last_height).as_str(), - )?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser.serialize_field( - "upgradedConsensusState", - pbjson::private::base64::encode(&self.upgraded_consensus_state).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryUpgradedConsensusStateResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["upgraded_consensus_state", "upgradedConsensusState"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - UpgradedConsensusState, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos.vesting.module.v1.rs b/packages/proto/src/gen/cosmos.vesting.module.v1.rs index 40dca13..2631fbf 100644 --- a/packages/proto/src/gen/cosmos.vesting.module.v1.rs +++ b/packages/proto/src/gen/cosmos.vesting.module.v1.rs @@ -1,5 +1,6 @@ // @generated /// Module is the config object of the vesting module. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module {} @@ -37,5 +38,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x00, 0x07, 0x87, 0xe8, 0xa2, 0x1b, 0x01, 0x12, 0x03, 0x09, 0x04, 0x3c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.vesting.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.vesting.module.v1.serde.rs b/packages/proto/src/gen/cosmos.vesting.module.v1.serde.rs deleted file mode 100644 index 7af893f..0000000 --- a/packages/proto/src/gen/cosmos.vesting.module.v1.serde.rs +++ /dev/null @@ -1,72 +0,0 @@ -// @generated -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.vesting.module.v1.Module", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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.vesting.module.v1.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.vesting.module.v1.Module", FIELDS, GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/cosmos.vesting.v1beta1.rs b/packages/proto/src/gen/cosmos.vesting.v1beta1.rs index 6b4d818..4afa053 100644 --- a/packages/proto/src/gen/cosmos.vesting.v1beta1.rs +++ b/packages/proto/src/gen/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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BaseVestingAccount { @@ -25,6 +26,7 @@ impl ::prost::Name for BaseVestingAccount { } /// ContinuousVestingAccount implements the VestingAccount interface. It /// continuously vests by unlocking coins linearly with respect to time. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ContinuousVestingAccount { @@ -44,6 +46,7 @@ impl ::prost::Name for 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelayedVestingAccount { @@ -58,6 +61,7 @@ impl ::prost::Name for DelayedVestingAccount { } } /// Period defines a length of time and amount of coins that will vest. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Period { @@ -76,6 +80,7 @@ impl ::prost::Name for Period { } /// PeriodicVestingAccount implements the VestingAccount interface. It /// periodically vests by unlocking coins during each specified period. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PeriodicVestingAccount { @@ -98,6 +103,7 @@ impl ::prost::Name for PeriodicVestingAccount { /// still be used for delegating and for governance votes even while locked. /// /// Since: cosmos-sdk 0.43 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PermanentLockedAccount { @@ -113,6 +119,7 @@ impl ::prost::Name for PermanentLockedAccount { } /// MsgCreateVestingAccount defines a message that enables creating a vesting /// account. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateVestingAccount { @@ -136,6 +143,7 @@ impl ::prost::Name for MsgCreateVestingAccount { } } /// MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateVestingAccountResponse {} @@ -150,6 +158,7 @@ impl ::prost::Name for MsgCreateVestingAccountResponse { /// locked account. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreatePermanentLockedAccount { @@ -170,6 +179,7 @@ impl ::prost::Name for MsgCreatePermanentLockedAccount { /// MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreatePermanentLockedAccountResponse {} @@ -184,6 +194,7 @@ impl ::prost::Name for MsgCreatePermanentLockedAccountResponse { /// account. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreatePeriodicVestingAccount { @@ -208,6 +219,7 @@ impl ::prost::Name for MsgCreatePeriodicVestingAccount { /// response type. /// /// Since: cosmos-sdk 0.46 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreatePeriodicVestingAccountResponse {} @@ -821,6 +833,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x0a, 0x03, 0x04, 0x05, 0x01, 0x12, 0x03, 0x63, 0x08, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos.vesting.v1beta1.serde.rs"); include!("cosmos.vesting.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos.vesting.v1beta1.serde.rs b/packages/proto/src/gen/cosmos.vesting.v1beta1.serde.rs deleted file mode 100644 index fa36be1..0000000 --- a/packages/proto/src/gen/cosmos.vesting.v1beta1.serde.rs +++ /dev/null @@ -1,1505 +0,0 @@ -// @generated -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 { - struct_ser.serialize_field("endTime", ToString::to_string(&self.end_time).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser - .serialize_field("startTime", ToString::to_string(&self.start_time).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/cosmos_proto.rs b/packages/proto/src/gen/cosmos_proto.rs index 7e42933..b06a351 100644 --- a/packages/proto/src/gen/cosmos_proto.rs +++ b/packages/proto/src/gen/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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InterfaceDescriptor { @@ -29,6 +30,7 @@ impl ::prost::Name for 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ScalarDescriptor { @@ -57,7 +59,19 @@ impl ::prost::Name for ScalarDescriptor { ::prost::alloc::format!("cosmos_proto.{}", Self::NAME) } } -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum ScalarType { Unspecified = 0, @@ -397,5 +411,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x15, 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x00, 0x02, 0x02, 0x02, 0x12, 0x03, 0x5f, 0x18, 0x19, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmos_proto.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmos_proto.serde.rs b/packages/proto/src/gen/cosmos_proto.serde.rs deleted file mode 100644 index 7c96cfc..0000000 --- a/packages/proto/src/gen/cosmos_proto.serde.rs +++ /dev/null @@ -1,328 +0,0 @@ -// @generated -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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::from_i32(v) - .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", v))) - }) - .collect::, _>>()?; - struct_ser.serialize_field("fieldType", &v)?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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) - } -} -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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ScalarType::from_i32) - .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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ScalarType::from_i32) - .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/packages/proto/src/gen/cosmwasm.wasm.v1.rs b/packages/proto/src/gen/cosmwasm.wasm.v1.rs index f5aacbc..a907003 100644 --- a/packages/proto/src/gen/cosmwasm.wasm.v1.rs +++ b/packages/proto/src/gen/cosmwasm.wasm.v1.rs @@ -1,5 +1,6 @@ // @generated /// AccessTypeParam +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AccessTypeParam { @@ -14,6 +15,7 @@ impl ::prost::Name for AccessTypeParam { } } /// AccessConfig access control type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AccessConfig { @@ -30,6 +32,7 @@ impl ::prost::Name for AccessConfig { } } /// Params defines the set of wasm parameters. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -46,6 +49,7 @@ impl ::prost::Name for Params { } } /// CodeInfo is data for the uploaded contract WASM code +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CodeInfo { @@ -67,6 +71,7 @@ impl ::prost::Name for CodeInfo { } } /// ContractInfo stores a WASM contract instance +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ContractInfo { @@ -100,6 +105,7 @@ impl ::prost::Name for ContractInfo { } } /// ContractCodeHistoryEntry metadata to a contract. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ContractCodeHistoryEntry { @@ -123,6 +129,7 @@ impl ::prost::Name for ContractCodeHistoryEntry { } /// AbsoluteTxPosition is a unique transaction position that allows for global /// ordering of transactions. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AbsoluteTxPosition { @@ -142,6 +149,7 @@ impl ::prost::Name for AbsoluteTxPosition { } } /// Model is a struct that holds a KV pair +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Model { @@ -160,7 +168,19 @@ impl ::prost::Name for Model { } } /// AccessType permission types -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum AccessType { /// AccessTypeUnspecified placeholder for empty value @@ -197,7 +217,19 @@ impl AccessType { } } /// ContractCodeHistoryOperationType actions that caused a code change -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum ContractCodeHistoryOperationType { /// ContractCodeHistoryOperationTypeUnspecified placeholder for empty value @@ -241,6 +273,7 @@ impl ContractCodeHistoryOperationType { } /// StoreCodeAuthorization defines authorization for wasm code upload. /// Since: wasmd 0.42 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreCodeAuthorization { @@ -257,6 +290,7 @@ impl ::prost::Name for StoreCodeAuthorization { } /// ContractExecutionAuthorization defines authorization for wasm execute. /// Since: wasmd 0.30 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ContractExecutionAuthorization { @@ -273,6 +307,7 @@ impl ::prost::Name for ContractExecutionAuthorization { } /// ContractMigrationAuthorization defines authorization for wasm contract /// migration. Since: wasmd 0.30 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ContractMigrationAuthorization { @@ -288,6 +323,7 @@ impl ::prost::Name for ContractMigrationAuthorization { } } /// CodeGrant a granted permission for a single code +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CodeGrant { @@ -310,6 +346,7 @@ impl ::prost::Name for CodeGrant { } /// ContractGrant a granted permission for a single contract /// Since: wasmd 0.30 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ContractGrant { @@ -335,6 +372,7 @@ impl ::prost::Name for ContractGrant { } /// MaxCallsLimit limited number of calls to the contract. No funds transferable. /// Since: wasmd 0.30 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MaxCallsLimit { @@ -351,6 +389,7 @@ impl ::prost::Name for MaxCallsLimit { } /// MaxFundsLimit defines the maximal amounts that can be sent to the contract. /// Since: wasmd 0.30 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MaxFundsLimit { @@ -368,6 +407,7 @@ impl ::prost::Name for MaxFundsLimit { /// CombinedLimit defines the maximal amounts that can be sent to a contract and /// the maximal number of calls executable. Both need to remain >0 to be valid. /// Since: wasmd 0.30 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CombinedLimit { @@ -388,6 +428,7 @@ impl ::prost::Name for CombinedLimit { /// AllowAllMessagesFilter is a wildcard to allow any type of contract payload /// message. /// Since: wasmd 0.30 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AllowAllMessagesFilter {} @@ -401,6 +442,7 @@ impl ::prost::Name for AllowAllMessagesFilter { /// AcceptedMessageKeysFilter accept only the specific contract message keys in /// the json object to be executed. /// Since: wasmd 0.30 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AcceptedMessageKeysFilter { @@ -418,6 +460,7 @@ impl ::prost::Name for AcceptedMessageKeysFilter { /// AcceptedMessagesFilter accept only the specific raw contract messages to be /// executed. /// Since: wasmd 0.30 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AcceptedMessagesFilter { @@ -433,6 +476,7 @@ impl ::prost::Name for AcceptedMessagesFilter { } } /// GenesisState - genesis state of x/wasm +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -453,6 +497,7 @@ impl ::prost::Name for GenesisState { } } /// Code struct encompasses CodeInfo and CodeBytes +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Code { @@ -474,6 +519,7 @@ impl ::prost::Name for Code { } } /// Contract struct encompasses ContractAddress, ContractInfo, and ContractState +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Contract { @@ -494,6 +540,7 @@ impl ::prost::Name for Contract { } } /// Sequence key and value of an id generation counter +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Sequence { @@ -510,6 +557,7 @@ impl ::prost::Name for Sequence { } } /// MsgIBCSend +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgIbcSend { @@ -537,6 +585,7 @@ impl ::prost::Name for MsgIbcSend { } } /// MsgIBCSendResponse +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgIbcSendResponse { @@ -552,6 +601,7 @@ impl ::prost::Name for MsgIbcSendResponse { } } /// MsgIBCCloseChannel port and channel need to be owned by the contract +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgIbcCloseChannel { @@ -569,6 +619,7 @@ impl ::prost::Name for MsgIbcCloseChannel { /// an explicit StoreCodeProposal. To submit WASM code to the system, /// a simple MsgStoreCode can be invoked from the x/gov module via /// a v1 governance proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreCodeProposal { @@ -613,6 +664,7 @@ impl ::prost::Name for StoreCodeProposal { /// an explicit InstantiateContractProposal. To instantiate a contract, /// a simple MsgInstantiateContract can be invoked from the x/gov module via /// a v1 governance proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InstantiateContractProposal { @@ -652,6 +704,7 @@ impl ::prost::Name for InstantiateContractProposal { /// an explicit InstantiateContract2Proposal. To instantiate contract 2, /// a simple MsgInstantiateContract2 can be invoked from the x/gov module via /// a v1 governance proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InstantiateContract2Proposal { @@ -698,6 +751,7 @@ impl ::prost::Name for InstantiateContract2Proposal { /// an explicit MigrateContractProposal. To migrate a contract, /// a simple MsgMigrateContract can be invoked from the x/gov module via /// a v1 governance proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MigrateContractProposal { @@ -730,6 +784,7 @@ impl ::prost::Name for MigrateContractProposal { /// an explicit SudoContractProposal. To call sudo on a contract, /// a simple MsgSudoContract can be invoked from the x/gov module via /// a v1 governance proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SudoContractProposal { @@ -757,6 +812,7 @@ impl ::prost::Name for SudoContractProposal { /// an explicit ExecuteContractProposal. To call execute on a contract, /// a simple MsgExecuteContract can be invoked from the x/gov module via /// a v1 governance proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExecuteContractProposal { @@ -790,6 +846,7 @@ impl ::prost::Name for ExecuteContractProposal { /// an explicit UpdateAdminProposal. To set an admin for a contract, /// a simple MsgUpdateAdmin can be invoked from the x/gov module via /// a v1 governance proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdateAdminProposal { @@ -817,6 +874,7 @@ impl ::prost::Name for UpdateAdminProposal { /// an explicit ClearAdminProposal. To clear the admin of a contract, /// a simple MsgClearAdmin can be invoked from the x/gov module via /// a v1 governance proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClearAdminProposal { @@ -841,6 +899,7 @@ impl ::prost::Name for ClearAdminProposal { /// an explicit PinCodesProposal. To pin a set of code ids in the wasmvm /// cache, a simple MsgPinCodes can be invoked from the x/gov module via /// a v1 governance proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PinCodesProposal { @@ -865,6 +924,7 @@ impl ::prost::Name for PinCodesProposal { /// an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm /// cache, a simple MsgUnpinCodes can be invoked from the x/gov module via /// a v1 governance proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UnpinCodesProposal { @@ -887,6 +947,7 @@ impl ::prost::Name for UnpinCodesProposal { } /// AccessConfigUpdate contains the code id and the access config to be /// applied. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AccessConfigUpdate { @@ -908,6 +969,7 @@ impl ::prost::Name for AccessConfigUpdate { /// an explicit UpdateInstantiateConfigProposal. To update instantiate config /// to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from /// the x/gov module via a v1 governance proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdateInstantiateConfigProposal { @@ -933,6 +995,7 @@ impl ::prost::Name for UpdateInstantiateConfigProposal { /// an explicit StoreAndInstantiateContractProposal. To store and instantiate /// the contract, a simple MsgStoreAndInstantiateContract can be invoked from /// the x/gov module via a v1 governance proposal. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreAndInstantiateContractProposal { @@ -987,6 +1050,7 @@ impl ::prost::Name for StoreAndInstantiateContractProposal { } /// QueryContractInfoRequest is the request type for the Query/ContractInfo RPC /// method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryContractInfoRequest { @@ -1003,6 +1067,7 @@ impl ::prost::Name for QueryContractInfoRequest { } /// QueryContractInfoResponse is the response type for the Query/ContractInfo RPC /// method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryContractInfoResponse { @@ -1021,6 +1086,7 @@ impl ::prost::Name for QueryContractInfoResponse { } /// QueryContractHistoryRequest is the request type for the Query/ContractHistory /// RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryContractHistoryRequest { @@ -1041,6 +1107,7 @@ impl ::prost::Name for QueryContractHistoryRequest { } /// QueryContractHistoryResponse is the response type for the /// Query/ContractHistory RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryContractHistoryResponse { @@ -1060,6 +1127,7 @@ impl ::prost::Name for QueryContractHistoryResponse { } /// QueryContractsByCodeRequest is the request type for the Query/ContractsByCode /// RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryContractsByCodeRequest { @@ -1080,6 +1148,7 @@ impl ::prost::Name for QueryContractsByCodeRequest { } /// QueryContractsByCodeResponse is the response type for the /// Query/ContractsByCode RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryContractsByCodeResponse { @@ -1100,6 +1169,7 @@ impl ::prost::Name for QueryContractsByCodeResponse { } /// QueryAllContractStateRequest is the request type for the /// Query/AllContractState RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllContractStateRequest { @@ -1120,6 +1190,7 @@ impl ::prost::Name for QueryAllContractStateRequest { } /// QueryAllContractStateResponse is the response type for the /// Query/AllContractState RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllContractStateResponse { @@ -1139,6 +1210,7 @@ impl ::prost::Name for QueryAllContractStateResponse { } /// QueryRawContractStateRequest is the request type for the /// Query/RawContractState RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryRawContractStateRequest { @@ -1157,6 +1229,7 @@ impl ::prost::Name for QueryRawContractStateRequest { } /// QueryRawContractStateResponse is the response type for the /// Query/RawContractState RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryRawContractStateResponse { @@ -1173,6 +1246,7 @@ impl ::prost::Name for QueryRawContractStateResponse { } /// QuerySmartContractStateRequest is the request type for the /// Query/SmartContractState RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySmartContractStateRequest { @@ -1192,6 +1266,7 @@ impl ::prost::Name for QuerySmartContractStateRequest { } /// QuerySmartContractStateResponse is the response type for the /// Query/SmartContractState RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySmartContractStateResponse { @@ -1207,6 +1282,7 @@ impl ::prost::Name for QuerySmartContractStateResponse { } } /// QueryCodeRequest is the request type for the Query/Code RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCodeRequest { @@ -1222,6 +1298,7 @@ impl ::prost::Name for QueryCodeRequest { } } /// CodeInfoResponse contains code meta data from CodeInfo +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CodeInfoResponse { @@ -1243,6 +1320,7 @@ impl ::prost::Name for CodeInfoResponse { } } /// QueryCodeResponse is the response type for the Query/Code RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCodeResponse { @@ -1259,6 +1337,7 @@ impl ::prost::Name for QueryCodeResponse { } } /// QueryCodesRequest is the request type for the Query/Codes RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCodesRequest { @@ -1275,6 +1354,7 @@ impl ::prost::Name for QueryCodesRequest { } } /// QueryCodesResponse is the response type for the Query/Codes RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCodesResponse { @@ -1294,6 +1374,7 @@ impl ::prost::Name for QueryCodesResponse { } /// QueryPinnedCodesRequest is the request type for the Query/PinnedCodes /// RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPinnedCodesRequest { @@ -1311,6 +1392,7 @@ impl ::prost::Name for QueryPinnedCodesRequest { } /// QueryPinnedCodesResponse is the response type for the /// Query/PinnedCodes RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPinnedCodesResponse { @@ -1329,6 +1411,7 @@ impl ::prost::Name for QueryPinnedCodesResponse { } } /// QueryParamsRequest is the request type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} @@ -1340,6 +1423,7 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse is the response type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -1356,6 +1440,7 @@ impl ::prost::Name for QueryParamsResponse { } /// QueryContractsByCreatorRequest is the request type for the /// Query/ContractsByCreator RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryContractsByCreatorRequest { @@ -1376,6 +1461,7 @@ impl ::prost::Name for QueryContractsByCreatorRequest { } /// QueryContractsByCreatorResponse is the response type for the /// Query/ContractsByCreator RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryContractsByCreatorResponse { @@ -1395,6 +1481,7 @@ impl ::prost::Name for QueryContractsByCreatorResponse { } } /// MsgStoreCode submit Wasm code to the system +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgStoreCode { @@ -1417,6 +1504,7 @@ impl ::prost::Name for MsgStoreCode { } } /// MsgStoreCodeResponse returns store result data. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgStoreCodeResponse { @@ -1436,6 +1524,7 @@ impl ::prost::Name for MsgStoreCodeResponse { } /// MsgInstantiateContract create a new smart contract instance for the given /// code id. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgInstantiateContract { @@ -1466,6 +1555,7 @@ impl ::prost::Name for MsgInstantiateContract { } } /// MsgInstantiateContractResponse return instantiation result data +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgInstantiateContractResponse { @@ -1485,6 +1575,7 @@ impl ::prost::Name for MsgInstantiateContractResponse { } /// MsgInstantiateContract2 create a new smart contract instance for the given /// code id with a predicable address. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgInstantiateContract2 { @@ -1522,6 +1613,7 @@ impl ::prost::Name for MsgInstantiateContract2 { } } /// MsgInstantiateContract2Response return instantiation result data +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgInstantiateContract2Response { @@ -1540,6 +1632,7 @@ impl ::prost::Name for MsgInstantiateContract2Response { } } /// MsgExecuteContract submits the given message data to a smart contract +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgExecuteContract { @@ -1564,6 +1657,7 @@ impl ::prost::Name for MsgExecuteContract { } } /// MsgExecuteContractResponse returns execution result data. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgExecuteContractResponse { @@ -1579,6 +1673,7 @@ impl ::prost::Name for MsgExecuteContractResponse { } } /// MsgMigrateContract runs a code upgrade/ downgrade for a smart contract +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgMigrateContract { @@ -1603,6 +1698,7 @@ impl ::prost::Name for MsgMigrateContract { } } /// MsgMigrateContractResponse returns contract migration result data. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgMigrateContractResponse { @@ -1619,6 +1715,7 @@ impl ::prost::Name for MsgMigrateContractResponse { } } /// MsgUpdateAdmin sets a new admin for a smart contract +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateAdmin { @@ -1640,6 +1737,7 @@ impl ::prost::Name for MsgUpdateAdmin { } } /// MsgUpdateAdminResponse returns empty data +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateAdminResponse {} @@ -1651,6 +1749,7 @@ impl ::prost::Name for MsgUpdateAdminResponse { } } /// MsgClearAdmin removes any admin stored for a smart contract +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgClearAdmin { @@ -1669,6 +1768,7 @@ impl ::prost::Name for MsgClearAdmin { } } /// MsgClearAdminResponse returns empty data +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgClearAdminResponse {} @@ -1680,6 +1780,7 @@ impl ::prost::Name for MsgClearAdminResponse { } } /// MsgUpdateInstantiateConfig updates instantiate config for a smart contract +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateInstantiateConfig { @@ -1701,6 +1802,7 @@ impl ::prost::Name for MsgUpdateInstantiateConfig { } } /// MsgUpdateInstantiateConfigResponse returns empty data +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateInstantiateConfigResponse {} @@ -1714,6 +1816,7 @@ impl ::prost::Name for MsgUpdateInstantiateConfigResponse { /// MsgUpdateParams is the MsgUpdateParams request type. /// /// Since: 0.40 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -1737,6 +1840,7 @@ impl ::prost::Name for MsgUpdateParams { /// MsgUpdateParams message. /// /// Since: 0.40 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} @@ -1750,6 +1854,7 @@ impl ::prost::Name for MsgUpdateParamsResponse { /// MsgSudoContract is the MsgSudoContract request type. /// /// Since: 0.40 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSudoContract { @@ -1774,6 +1879,7 @@ impl ::prost::Name for MsgSudoContract { /// MsgSudoContract message. /// /// Since: 0.40 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSudoContractResponse { @@ -1791,6 +1897,7 @@ impl ::prost::Name for MsgSudoContractResponse { /// MsgPinCodes is the MsgPinCodes request type. /// /// Since: 0.40 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgPinCodes { @@ -1812,6 +1919,7 @@ impl ::prost::Name for MsgPinCodes { /// MsgPinCodes message. /// /// Since: 0.40 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgPinCodesResponse {} @@ -1825,6 +1933,7 @@ impl ::prost::Name for MsgPinCodesResponse { /// MsgUnpinCodes is the MsgUnpinCodes request type. /// /// Since: 0.40 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUnpinCodes { @@ -1846,6 +1955,7 @@ impl ::prost::Name for MsgUnpinCodes { /// MsgUnpinCodes message. /// /// Since: 0.40 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUnpinCodesResponse {} @@ -1860,6 +1970,7 @@ impl ::prost::Name for MsgUnpinCodesResponse { /// request type. /// /// Since: 0.40 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgStoreAndInstantiateContract { @@ -1912,6 +2023,7 @@ impl ::prost::Name for MsgStoreAndInstantiateContract { /// for executing a MsgStoreAndInstantiateContract message. /// /// Since: 0.40 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgStoreAndInstantiateContractResponse { @@ -1931,6 +2043,7 @@ impl ::prost::Name for MsgStoreAndInstantiateContractResponse { } /// MsgAddCodeUploadParamsAddresses is the /// MsgAddCodeUploadParamsAddresses request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgAddCodeUploadParamsAddresses { @@ -1949,6 +2062,7 @@ impl ::prost::Name for MsgAddCodeUploadParamsAddresses { } /// MsgAddCodeUploadParamsAddressesResponse defines the response /// structure for executing a MsgAddCodeUploadParamsAddresses message. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgAddCodeUploadParamsAddressesResponse {} @@ -1961,6 +2075,7 @@ impl ::prost::Name for MsgAddCodeUploadParamsAddressesResponse { } /// MsgRemoveCodeUploadParamsAddresses is the /// MsgRemoveCodeUploadParamsAddresses request type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRemoveCodeUploadParamsAddresses { @@ -1979,6 +2094,7 @@ impl ::prost::Name for MsgRemoveCodeUploadParamsAddresses { } /// MsgRemoveCodeUploadParamsAddressesResponse defines the response /// structure for executing a MsgRemoveCodeUploadParamsAddresses message. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRemoveCodeUploadParamsAddressesResponse {} @@ -1993,6 +2109,7 @@ impl ::prost::Name for MsgRemoveCodeUploadParamsAddressesResponse { /// request type. /// /// Since: 0.42 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgStoreAndMigrateContract { @@ -2023,6 +2140,7 @@ impl ::prost::Name for MsgStoreAndMigrateContract { /// for executing a MsgStoreAndMigrateContract message. /// /// Since: 0.42 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgStoreAndMigrateContractResponse { @@ -2044,6 +2162,7 @@ impl ::prost::Name for MsgStoreAndMigrateContractResponse { } } /// MsgUpdateContractLabel sets a new label for a smart contract +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateContractLabel { @@ -2065,6 +2184,7 @@ impl ::prost::Name for MsgUpdateContractLabel { } } /// MsgUpdateContractLabelResponse returns empty data +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateContractLabelResponse {} @@ -6883,6 +7003,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x20, 0x64, 0x61, 0x74, 0x61, 0x0a, 0x0a, 0x0b, 0x0a, 0x03, 0x04, 0x21, 0x01, 0x12, 0x04, 0xec, 0x03, 0x08, 0x26, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("cosmwasm.wasm.v1.serde.rs"); include!("cosmwasm.wasm.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/cosmwasm.wasm.v1.serde.rs b/packages/proto/src/gen/cosmwasm.wasm.v1.serde.rs deleted file mode 100644 index d16915c..0000000 --- a/packages/proto/src/gen/cosmwasm.wasm.v1.serde.rs +++ /dev/null @@ -1,12559 +0,0 @@ -// @generated -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 { - struct_ser.serialize_field( - "blockHeight", - ToString::to_string(&self.block_height).as_str(), - )?; - } - if self.tx_index != 0 { - struct_ser.serialize_field("txIndex", ToString::to_string(&self.tx_index).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -impl serde::Serialize for AcceptedMessageKeysFilter { - #[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("cosmwasm.wasm.v1.AcceptedMessageKeysFilter", len)?; - if !self.keys.is_empty() { - struct_ser.serialize_field("keys", &self.keys)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for AcceptedMessageKeysFilter { - #[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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = AcceptedMessageKeysFilter; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.AcceptedMessageKeysFilter") - } - - 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()?); - } - } - } - Ok(AcceptedMessageKeysFilter { - keys: keys__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.AcceptedMessageKeysFilter", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for AcceptedMessagesFilter { - #[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; - } - let mut struct_ser = - serializer.serialize_struct("cosmwasm.wasm.v1.AcceptedMessagesFilter", len)?; - if !self.messages.is_empty() { - struct_ser.serialize_field( - "messages", - &self - .messages - .iter() - .map(pbjson::private::base64::encode) - .collect::>(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for AcceptedMessagesFilter { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["messages"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Messages, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = AcceptedMessagesFilter; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.AcceptedMessagesFilter") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut messages__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Messages => { - if messages__.is_some() { - return Err(serde::de::Error::duplicate_field("messages")); - } - messages__ = Some( - map.next_value::>>()? - .into_iter() - .map(|x| x.0) - .collect(), - ); - } - } - } - Ok(AcceptedMessagesFilter { - messages: messages__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.AcceptedMessagesFilter", - FIELDS, - GeneratedVisitor, - ) - } -} -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.addresses.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.AccessConfig", len)?; - if self.permission != 0 { - let v = AccessType::from_i32(self.permission).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.permission)) - })?; - struct_ser.serialize_field("permission", &v)?; - } - if !self.addresses.is_empty() { - struct_ser.serialize_field("addresses", &self.addresses)?; - } - struct_ser.end() - } -} -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", "addresses"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Permission, - Addresses, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "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 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::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(), - addresses: addresses__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmwasm.wasm.v1.AccessConfig", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for AccessConfigUpdate { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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::Everybody => "ACCESS_TYPE_EVERYBODY", - Self::AnyOfAddresses => "ACCESS_TYPE_ANY_OF_ADDRESSES", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for AccessType { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "ACCESS_TYPE_UNSPECIFIED", - "ACCESS_TYPE_NOBODY", - "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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(AccessType::from_i32) - .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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(AccessType::from_i32) - .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_EVERYBODY" => Ok(AccessType::Everybody), - "ACCESS_TYPE_ANY_OF_ADDRESSES" => Ok(AccessType::AnyOfAddresses), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for AccessTypeParam { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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::from_i32(self.value).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.value)) - })?; - struct_ser.serialize_field("value", &v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for AccessTypeParam { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["value"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Value, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -impl serde::Serialize for AllowAllMessagesFilter { - #[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.AllowAllMessagesFilter", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for AllowAllMessagesFilter { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = AllowAllMessagesFilter; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.AllowAllMessagesFilter") - } - - 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(AllowAllMessagesFilter {}) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.AllowAllMessagesFilter", - FIELDS, - GeneratedVisitor, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -impl serde::Serialize for CodeGrant { - #[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.instantiate_permission.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.CodeGrant", len)?; - if !self.code_hash.is_empty() { - struct_ser.serialize_field( - "codeHash", - pbjson::private::base64::encode(&self.code_hash).as_str(), - )?; - } - if let Some(v) = self.instantiate_permission.as_ref() { - struct_ser.serialize_field("instantiatePermission", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CodeGrant { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "code_hash", - "codeHash", - "instantiate_permission", - "instantiatePermission", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - CodeHash, - InstantiatePermission, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "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 = CodeGrant; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.CodeGrant") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut code_hash__ = None; - let mut instantiate_permission__ = 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::InstantiatePermission => { - if instantiate_permission__.is_some() { - return Err(serde::de::Error::duplicate_field( - "instantiatePermission", - )); - } - instantiate_permission__ = map.next_value()?; - } - } - } - Ok(CodeGrant { - code_hash: code_hash__.unwrap_or_default(), - instantiate_permission: instantiate_permission__, - }) - } - } - deserializer.deserialize_struct("cosmwasm.wasm.v1.CodeGrant", FIELDS, GeneratedVisitor) - } -} -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() { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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 { - 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() { - struct_ser.serialize_field( - "dataHash", - pbjson::private::base64::encode(&self.data_hash).as_str(), - )?; - } - if let Some(v) = self.instantiate_permission.as_ref() { - struct_ser.serialize_field("instantiatePermission", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CodeInfoResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -impl serde::Serialize for CombinedLimit { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.calls_remaining != 0 { - len += 1; - } - if !self.amounts.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.CombinedLimit", len)?; - if self.calls_remaining != 0 { - struct_ser.serialize_field( - "callsRemaining", - ToString::to_string(&self.calls_remaining).as_str(), - )?; - } - if !self.amounts.is_empty() { - struct_ser.serialize_field("amounts", &self.amounts)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CombinedLimit { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["calls_remaining", "callsRemaining", "amounts"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - CallsRemaining, - Amounts, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "callsRemaining" | "calls_remaining" => { - Ok(GeneratedField::CallsRemaining) - } - "amounts" => Ok(GeneratedField::Amounts), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CombinedLimit; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.CombinedLimit") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut calls_remaining__ = None; - let mut amounts__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::CallsRemaining => { - if calls_remaining__.is_some() { - return Err(serde::de::Error::duplicate_field("callsRemaining")); - } - calls_remaining__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Amounts => { - if amounts__.is_some() { - return Err(serde::de::Error::duplicate_field("amounts")); - } - amounts__ = Some(map.next_value()?); - } - } - } - Ok(CombinedLimit { - calls_remaining: calls_remaining__.unwrap_or_default(), - amounts: amounts__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmwasm.wasm.v1.CombinedLimit", FIELDS, GeneratedVisitor) - } -} -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; - } - if !self.contract_code_history.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)?; - } - if !self.contract_code_history.is_empty() { - struct_ser.serialize_field("contractCodeHistory", &self.contract_code_history)?; - } - struct_ser.end() - } -} -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", - "contract_code_history", - "contractCodeHistory", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ContractAddress, - ContractInfo, - ContractState, - ContractCodeHistory, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "contractCodeHistory" | "contract_code_history" => { - Ok(GeneratedField::ContractCodeHistory) - } - _ => 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; - let mut contract_code_history__ = 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()?); - } - GeneratedField::ContractCodeHistory => { - if contract_code_history__.is_some() { - return Err(serde::de::Error::duplicate_field( - "contractCodeHistory", - )); - } - contract_code_history__ = Some(map.next_value()?); - } - } - } - Ok(Contract { - contract_address: contract_address__.unwrap_or_default(), - contract_info: contract_info__, - contract_state: contract_state__.unwrap_or_default(), - contract_code_history: contract_code_history__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmwasm.wasm.v1.Contract", FIELDS, GeneratedVisitor) - } -} -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::from_i32(self.operation).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.operation)) - })?; - struct_ser.serialize_field("operation", &v)?; - } - if self.code_id != 0 { - 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() { - struct_ser - .serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ContractCodeHistoryEntry { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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) - } -} -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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ContractCodeHistoryOperationType::from_i32) - .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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ContractCodeHistoryOperationType::from_i32) - .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) - } -} -impl serde::Serialize for ContractExecutionAuthorization { - #[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; - } - let mut struct_ser = - serializer.serialize_struct("cosmwasm.wasm.v1.ContractExecutionAuthorization", len)?; - if !self.grants.is_empty() { - struct_ser.serialize_field("grants", &self.grants)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ContractExecutionAuthorization { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["grants"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Grants, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ContractExecutionAuthorization; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.ContractExecutionAuthorization") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut grants__ = 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()?); - } - } - } - Ok(ContractExecutionAuthorization { - grants: grants__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.ContractExecutionAuthorization", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ContractGrant { - #[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.is_empty() { - len += 1; - } - if self.limit.is_some() { - len += 1; - } - if self.filter.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.ContractGrant", len)?; - if !self.contract.is_empty() { - struct_ser.serialize_field("contract", &self.contract)?; - } - if let Some(v) = self.limit.as_ref() { - struct_ser.serialize_field("limit", v)?; - } - if let Some(v) = self.filter.as_ref() { - struct_ser.serialize_field("filter", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ContractGrant { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["contract", "limit", "filter"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Contract, - Limit, - Filter, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "contract" => Ok(GeneratedField::Contract), - "limit" => Ok(GeneratedField::Limit), - "filter" => Ok(GeneratedField::Filter), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ContractGrant; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.ContractGrant") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut contract__ = None; - let mut limit__ = None; - let mut filter__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Contract => { - if contract__.is_some() { - return Err(serde::de::Error::duplicate_field("contract")); - } - contract__ = Some(map.next_value()?); - } - GeneratedField::Limit => { - if limit__.is_some() { - return Err(serde::de::Error::duplicate_field("limit")); - } - limit__ = map.next_value()?; - } - GeneratedField::Filter => { - if filter__.is_some() { - return Err(serde::de::Error::duplicate_field("filter")); - } - filter__ = map.next_value()?; - } - } - } - Ok(ContractGrant { - contract: contract__.unwrap_or_default(), - limit: limit__, - filter: filter__, - }) - } - } - deserializer.deserialize_struct("cosmwasm.wasm.v1.ContractGrant", FIELDS, GeneratedVisitor) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -impl serde::Serialize for ContractMigrationAuthorization { - #[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; - } - let mut struct_ser = - serializer.serialize_struct("cosmwasm.wasm.v1.ContractMigrationAuthorization", len)?; - if !self.grants.is_empty() { - struct_ser.serialize_field("grants", &self.grants)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ContractMigrationAuthorization { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["grants"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Grants, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ContractMigrationAuthorization; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.ContractMigrationAuthorization") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut grants__ = 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()?); - } - } - } - Ok(ContractMigrationAuthorization { - grants: grants__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.ContractMigrationAuthorization", - FIELDS, - GeneratedVisitor, - ) - } -} -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() { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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; - } - 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)?; - } - struct_ser.end() - } -} -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"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - Codes, - Contracts, - Sequences, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - _ => 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; - 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()?); - } - } - } - Ok(GenesisState { - params: params__, - codes: codes__.unwrap_or_default(), - contracts: contracts__.unwrap_or_default(), - sequences: sequences__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmwasm.wasm.v1.GenesisState", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for InstantiateContract2Proposal { - #[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; - } - if !self.salt.is_empty() { - len += 1; - } - if self.fix_msg { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmwasm.wasm.v1.InstantiateContract2Proposal", 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 { - 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() { - 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() { - 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() - } -} -impl<'de> serde::Deserialize<'de> for InstantiateContract2Proposal { - #[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", - "salt", - "fix_msg", - "fixMsg", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Title, - Description, - RunAs, - Admin, - CodeId, - Label, - Msg, - Funds, - Salt, - FixMsg, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "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 = InstantiateContract2Proposal; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.InstantiateContract2Proposal") - } - - 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; - let mut salt__ = None; - let mut fix_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::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()?); - } - 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(InstantiateContract2Proposal { - 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(), - salt: salt__.unwrap_or_default(), - fix_msg: fix_msg__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.InstantiateContract2Proposal", - FIELDS, - GeneratedVisitor, - ) - } -} -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 { - 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() { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -impl serde::Serialize for MaxCallsLimit { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.remaining != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.MaxCallsLimit", len)?; - if self.remaining != 0 { - struct_ser - .serialize_field("remaining", ToString::to_string(&self.remaining).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MaxCallsLimit { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["remaining"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Remaining, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "remaining" => Ok(GeneratedField::Remaining), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MaxCallsLimit; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.MaxCallsLimit") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut remaining__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Remaining => { - if remaining__.is_some() { - return Err(serde::de::Error::duplicate_field("remaining")); - } - remaining__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(MaxCallsLimit { - remaining: remaining__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmwasm.wasm.v1.MaxCallsLimit", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MaxFundsLimit { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.amounts.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.MaxFundsLimit", len)?; - if !self.amounts.is_empty() { - struct_ser.serialize_field("amounts", &self.amounts)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MaxFundsLimit { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["amounts"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Amounts, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "amounts" => Ok(GeneratedField::Amounts), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MaxFundsLimit; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.MaxFundsLimit") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut amounts__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Amounts => { - if amounts__.is_some() { - return Err(serde::de::Error::duplicate_field("amounts")); - } - amounts__ = Some(map.next_value()?); - } - } - } - Ok(MaxFundsLimit { - amounts: amounts__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmwasm.wasm.v1.MaxFundsLimit", FIELDS, GeneratedVisitor) - } -} -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 { - struct_ser.serialize_field("codeId", ToString::to_string(&self.code_id).as_str())?; - } - if !self.msg.is_empty() { - struct_ser - .serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MigrateContractProposal { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser - .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if !self.value.is_empty() { - struct_ser.serialize_field( - "value", - pbjson::private::base64::encode(&self.value).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Model { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["key", "value"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Value, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -impl serde::Serialize for MsgAddCodeUploadParamsAddresses { - #[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.addresses.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", len)?; - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - if !self.addresses.is_empty() { - struct_ser.serialize_field("addresses", &self.addresses)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgAddCodeUploadParamsAddresses { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["authority", "addresses"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authority, - Addresses, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "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 = MsgAddCodeUploadParamsAddresses; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authority__ = None; - let mut addresses__ = 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::Addresses => { - if addresses__.is_some() { - return Err(serde::de::Error::duplicate_field("addresses")); - } - addresses__ = Some(map.next_value()?); - } - } - } - Ok(MsgAddCodeUploadParamsAddresses { - authority: authority__.unwrap_or_default(), - addresses: addresses__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgAddCodeUploadParamsAddressesResponse { - #[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.MsgAddCodeUploadParamsAddressesResponse", - len, - )?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgAddCodeUploadParamsAddressesResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgAddCodeUploadParamsAddressesResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse") - } - - 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(MsgAddCodeUploadParamsAddressesResponse {}) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgExecuteContractResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["data"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Data, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field( - "timeoutHeight", - ToString::to_string(&self.timeout_height).as_str(), - )?; - } - if self.timeout_timestamp != 0 { - struct_ser.serialize_field( - "timeoutTimestamp", - ToString::to_string(&self.timeout_timestamp).as_str(), - )?; - } - if !self.data.is_empty() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgIbcSend { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -impl serde::Serialize for MsgIbcSendResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.sequence != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmwasm.wasm.v1.MsgIBCSendResponse", len)?; - if self.sequence != 0 { - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgIbcSendResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["sequence"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Sequence, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "sequence" => Ok(GeneratedField::Sequence), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgIbcSendResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.MsgIBCSendResponse") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sequence__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(MsgIbcSendResponse { - sequence: sequence__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.MsgIBCSendResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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 { - 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() { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() { - 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() { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgInstantiateContract2Response { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["address", "data"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Address, - Data, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgInstantiateContractResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["address", "data"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Address, - Data, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field("codeId", ToString::to_string(&self.code_id).as_str())?; - } - if !self.msg.is_empty() { - struct_ser - .serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgMigrateContract { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgMigrateContractResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["data"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Data, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -impl serde::Serialize for MsgPinCodes { - #[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.code_ids.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.MsgPinCodes", len)?; - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - if !self.code_ids.is_empty() { - struct_ser.serialize_field( - "codeIds", - &self - .code_ids - .iter() - .map(ToString::to_string) - .collect::>(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgPinCodes { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["authority", "code_ids", "codeIds"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authority, - CodeIds, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "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 = MsgPinCodes; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.MsgPinCodes") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authority__ = None; - let mut code_ids__ = 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::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(MsgPinCodes { - authority: authority__.unwrap_or_default(), - code_ids: code_ids__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmwasm.wasm.v1.MsgPinCodes", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgPinCodesResponse { - #[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.MsgPinCodesResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgPinCodesResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgPinCodesResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.MsgPinCodesResponse") - } - - 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(MsgPinCodesResponse {}) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.MsgPinCodesResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgRemoveCodeUploadParamsAddresses { - #[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.addresses.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", len)?; - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - if !self.addresses.is_empty() { - struct_ser.serialize_field("addresses", &self.addresses)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgRemoveCodeUploadParamsAddresses { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["authority", "addresses"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authority, - Addresses, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "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 = MsgRemoveCodeUploadParamsAddresses; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authority__ = None; - let mut addresses__ = 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::Addresses => { - if addresses__.is_some() { - return Err(serde::de::Error::duplicate_field("addresses")); - } - addresses__ = Some(map.next_value()?); - } - } - } - Ok(MsgRemoveCodeUploadParamsAddresses { - authority: authority__.unwrap_or_default(), - addresses: addresses__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgRemoveCodeUploadParamsAddressesResponse { - #[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.MsgRemoveCodeUploadParamsAddressesResponse", - len, - )?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgRemoveCodeUploadParamsAddressesResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgRemoveCodeUploadParamsAddressesResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse") - } - - 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(MsgRemoveCodeUploadParamsAddressesResponse {}) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgStoreAndInstantiateContract { - #[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.wasm_byte_code.is_empty() { - len += 1; - } - if self.instantiate_permission.is_some() { - len += 1; - } - if self.unpin_code { - len += 1; - } - if !self.admin.is_empty() { - 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.source.is_empty() { - len += 1; - } - if !self.builder.is_empty() { - len += 1; - } - if !self.code_hash.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", len)?; - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - if !self.wasm_byte_code.is_empty() { - 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)?; - } - 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 !self.msg.is_empty() { - 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.source.is_empty() { - struct_ser.serialize_field("source", &self.source)?; - } - if !self.builder.is_empty() { - struct_ser.serialize_field("builder", &self.builder)?; - } - if !self.code_hash.is_empty() { - struct_ser.serialize_field( - "codeHash", - pbjson::private::base64::encode(&self.code_hash).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgStoreAndInstantiateContract { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "authority", - "wasm_byte_code", - "wasmByteCode", - "instantiate_permission", - "instantiatePermission", - "unpin_code", - "unpinCode", - "admin", - "label", - "msg", - "funds", - "source", - "builder", - "code_hash", - "codeHash", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authority, - WasmByteCode, - InstantiatePermission, - UnpinCode, - Admin, - Label, - Msg, - Funds, - Source, - Builder, - CodeHash, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "wasmByteCode" | "wasm_byte_code" => Ok(GeneratedField::WasmByteCode), - "instantiatePermission" | "instantiate_permission" => { - Ok(GeneratedField::InstantiatePermission) - } - "unpinCode" | "unpin_code" => Ok(GeneratedField::UnpinCode), - "admin" => Ok(GeneratedField::Admin), - "label" => Ok(GeneratedField::Label), - "msg" => Ok(GeneratedField::Msg), - "funds" => Ok(GeneratedField::Funds), - "source" => Ok(GeneratedField::Source), - "builder" => Ok(GeneratedField::Builder), - "codeHash" | "code_hash" => Ok(GeneratedField::CodeHash), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgStoreAndInstantiateContract; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.MsgStoreAndInstantiateContract") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authority__ = None; - let mut wasm_byte_code__ = None; - let mut instantiate_permission__ = None; - let mut unpin_code__ = None; - let mut admin__ = None; - let mut label__ = None; - let mut msg__ = None; - let mut funds__ = None; - let mut source__ = None; - let mut builder__ = None; - let mut code_hash__ = 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::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()?); - } - 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::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::Source => { - if source__.is_some() { - return Err(serde::de::Error::duplicate_field("source")); - } - source__ = Some(map.next_value()?); - } - GeneratedField::Builder => { - if builder__.is_some() { - return Err(serde::de::Error::duplicate_field("builder")); - } - builder__ = Some(map.next_value()?); - } - 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, - ); - } - } - } - Ok(MsgStoreAndInstantiateContract { - authority: authority__.unwrap_or_default(), - wasm_byte_code: wasm_byte_code__.unwrap_or_default(), - instantiate_permission: instantiate_permission__, - unpin_code: unpin_code__.unwrap_or_default(), - admin: admin__.unwrap_or_default(), - label: label__.unwrap_or_default(), - msg: msg__.unwrap_or_default(), - funds: funds__.unwrap_or_default(), - source: source__.unwrap_or_default(), - builder: builder__.unwrap_or_default(), - code_hash: code_hash__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgStoreAndInstantiateContractResponse { - #[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.MsgStoreAndInstantiateContractResponse", - len, - )?; - if !self.address.is_empty() { - struct_ser.serialize_field("address", &self.address)?; - } - if !self.data.is_empty() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgStoreAndInstantiateContractResponse { - #[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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = MsgStoreAndInstantiateContractResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse") - } - - 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(MsgStoreAndInstantiateContractResponse { - address: address__.unwrap_or_default(), - data: data__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgStoreAndMigrateContract { - #[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.wasm_byte_code.is_empty() { - len += 1; - } - if self.instantiate_permission.is_some() { - 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.MsgStoreAndMigrateContract", len)?; - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - if !self.wasm_byte_code.is_empty() { - 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.contract.is_empty() { - struct_ser.serialize_field("contract", &self.contract)?; - } - if !self.msg.is_empty() { - struct_ser - .serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgStoreAndMigrateContract { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "authority", - "wasm_byte_code", - "wasmByteCode", - "instantiate_permission", - "instantiatePermission", - "contract", - "msg", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authority, - WasmByteCode, - InstantiatePermission, - Contract, - Msg, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "wasmByteCode" | "wasm_byte_code" => Ok(GeneratedField::WasmByteCode), - "instantiatePermission" | "instantiate_permission" => { - Ok(GeneratedField::InstantiatePermission) - } - "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 = MsgStoreAndMigrateContract; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.MsgStoreAndMigrateContract") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authority__ = None; - let mut wasm_byte_code__ = None; - let mut instantiate_permission__ = None; - let mut contract__ = None; - let mut msg__ = 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::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::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(MsgStoreAndMigrateContract { - authority: authority__.unwrap_or_default(), - wasm_byte_code: wasm_byte_code__.unwrap_or_default(), - instantiate_permission: instantiate_permission__, - contract: contract__.unwrap_or_default(), - msg: msg__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.MsgStoreAndMigrateContract", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgStoreAndMigrateContractResponse { - #[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; - } - if !self.data.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse", len)?; - if self.code_id != 0 { - struct_ser.serialize_field("codeId", ToString::to_string(&self.code_id).as_str())?; - } - if !self.checksum.is_empty() { - struct_ser.serialize_field( - "checksum", - pbjson::private::base64::encode(&self.checksum).as_str(), - )?; - } - if !self.data.is_empty() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgStoreAndMigrateContractResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["code_id", "codeId", "checksum", "data"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - CodeId, - Checksum, - Data, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "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 = MsgStoreAndMigrateContractResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse") - } - - 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; - let mut data__ = 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, - ); - } - GeneratedField::Data => { - if data__.is_some() { - return Err(serde::de::Error::duplicate_field("data")); - } - data__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - } - } - Ok(MsgStoreAndMigrateContractResponse { - code_id: code_id__.unwrap_or_default(), - checksum: checksum__.unwrap_or_default(), - data: data__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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() { - struct_ser.serialize_field( - "wasmByteCode", - pbjson::private::base64::encode(&self.wasm_byte_code).as_str(), - )?; - } - if let Some(v) = self.instantiate_permission.as_ref() { - struct_ser.serialize_field("instantiatePermission", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgStoreCode { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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 { - struct_ser.serialize_field("codeId", ToString::to_string(&self.code_id).as_str())?; - } - if !self.checksum.is_empty() { - struct_ser.serialize_field( - "checksum", - pbjson::private::base64::encode(&self.checksum).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgStoreCodeResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["code_id", "codeId", "checksum"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - CodeId, - Checksum, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -impl serde::Serialize for MsgSudoContract { - #[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.contract.is_empty() { - len += 1; - } - if !self.msg.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmwasm.wasm.v1.MsgSudoContract", len)?; - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - if !self.contract.is_empty() { - struct_ser.serialize_field("contract", &self.contract)?; - } - if !self.msg.is_empty() { - struct_ser - .serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSudoContract { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["authority", "contract", "msg"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authority, - Contract, - Msg, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "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 = MsgSudoContract; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.MsgSudoContract") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authority__ = None; - let mut contract__ = None; - let mut msg__ = 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::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(MsgSudoContract { - authority: authority__.unwrap_or_default(), - contract: contract__.unwrap_or_default(), - msg: msg__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.MsgSudoContract", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgSudoContractResponse { - #[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.MsgSudoContractResponse", len)?; - if !self.data.is_empty() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSudoContractResponse { - #[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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = MsgSudoContractResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.MsgSudoContractResponse") - } - - 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(MsgSudoContractResponse { - data: data__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.MsgSudoContractResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgUnpinCodes { - #[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.code_ids.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.MsgUnpinCodes", len)?; - if !self.authority.is_empty() { - struct_ser.serialize_field("authority", &self.authority)?; - } - if !self.code_ids.is_empty() { - struct_ser.serialize_field( - "codeIds", - &self - .code_ids - .iter() - .map(ToString::to_string) - .collect::>(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUnpinCodes { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["authority", "code_ids", "codeIds"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Authority, - CodeIds, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "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 = MsgUnpinCodes; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.MsgUnpinCodes") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut authority__ = None; - let mut code_ids__ = 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::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(MsgUnpinCodes { - authority: authority__.unwrap_or_default(), - code_ids: code_ids__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmwasm.wasm.v1.MsgUnpinCodes", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgUnpinCodesResponse { - #[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.MsgUnpinCodesResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUnpinCodesResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgUnpinCodesResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.MsgUnpinCodesResponse") - } - - 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(MsgUnpinCodesResponse {}) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.MsgUnpinCodesResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -impl serde::Serialize for MsgUpdateContractLabel { - #[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_label.is_empty() { - len += 1; - } - if !self.contract.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmwasm.wasm.v1.MsgUpdateContractLabel", len)?; - if !self.sender.is_empty() { - struct_ser.serialize_field("sender", &self.sender)?; - } - if !self.new_label.is_empty() { - struct_ser.serialize_field("newLabel", &self.new_label)?; - } - if !self.contract.is_empty() { - struct_ser.serialize_field("contract", &self.contract)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUpdateContractLabel { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["sender", "new_label", "newLabel", "contract"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Sender, - NewLabel, - Contract, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "newLabel" | "new_label" => Ok(GeneratedField::NewLabel), - "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 = MsgUpdateContractLabel; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.MsgUpdateContractLabel") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sender__ = None; - let mut new_label__ = 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::NewLabel => { - if new_label__.is_some() { - return Err(serde::de::Error::duplicate_field("newLabel")); - } - new_label__ = Some(map.next_value()?); - } - GeneratedField::Contract => { - if contract__.is_some() { - return Err(serde::de::Error::duplicate_field("contract")); - } - contract__ = Some(map.next_value()?); - } - } - } - Ok(MsgUpdateContractLabel { - sender: sender__.unwrap_or_default(), - new_label: new_label__.unwrap_or_default(), - contract: contract__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.MsgUpdateContractLabel", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgUpdateContractLabelResponse { - #[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.MsgUpdateContractLabelResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUpdateContractLabelResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgUpdateContractLabelResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.MsgUpdateContractLabelResponse") - } - - 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(MsgUpdateContractLabelResponse {}) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.MsgUpdateContractLabelResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgUpdateInstantiateConfig { - #[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.new_instantiate_permission.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", len)?; - if !self.sender.is_empty() { - struct_ser.serialize_field("sender", &self.sender)?; - } - if self.code_id != 0 { - struct_ser.serialize_field("codeId", ToString::to_string(&self.code_id).as_str())?; - } - if let Some(v) = self.new_instantiate_permission.as_ref() { - struct_ser.serialize_field("newInstantiatePermission", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUpdateInstantiateConfig { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "sender", - "code_id", - "codeId", - "new_instantiate_permission", - "newInstantiatePermission", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Sender, - CodeId, - NewInstantiatePermission, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "newInstantiatePermission" | "new_instantiate_permission" => { - Ok(GeneratedField::NewInstantiatePermission) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgUpdateInstantiateConfig; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.MsgUpdateInstantiateConfig") - } - - 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 new_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::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::NewInstantiatePermission => { - if new_instantiate_permission__.is_some() { - return Err(serde::de::Error::duplicate_field( - "newInstantiatePermission", - )); - } - new_instantiate_permission__ = map.next_value()?; - } - } - } - Ok(MsgUpdateInstantiateConfig { - sender: sender__.unwrap_or_default(), - code_id: code_id__.unwrap_or_default(), - new_instantiate_permission: new_instantiate_permission__, - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgUpdateInstantiateConfigResponse { - #[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.MsgUpdateInstantiateConfigResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUpdateInstantiateConfigResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgUpdateInstantiateConfigResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse") - } - - 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(MsgUpdateInstantiateConfigResponse {}) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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("cosmwasm.wasm.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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 cosmwasm.wasm.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( - "cosmwasm.wasm.v1.MsgUpdateParams", - FIELDS, - GeneratedVisitor, - ) - } -} -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("cosmwasm.wasm.v1.MsgUpdateParamsResponse", len)?; - struct_ser.end() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 cosmwasm.wasm.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( - "cosmwasm.wasm.v1.MsgUpdateParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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::from_i32(self.instantiate_default_permission).ok_or_else(|| { - serde::ser::Error::custom(format!( - "Invalid variant {}", - self.instantiate_default_permission - )) - })?; - struct_ser.serialize_field("instantiateDefaultPermission", &v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Params { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - struct_ser.serialize_field("codeId", ToString::to_string(&self.code_id).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryCodeResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["code_info", "codeInfo", "data"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - CodeInfo, - Data, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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 { - 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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -impl serde::Serialize for QueryContractsByCreatorRequest { - #[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_address.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmwasm.wasm.v1.QueryContractsByCreatorRequest", len)?; - if !self.creator_address.is_empty() { - struct_ser.serialize_field("creatorAddress", &self.creator_address)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryContractsByCreatorRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["creator_address", "creatorAddress", "pagination"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - CreatorAddress, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "creatorAddress" | "creator_address" => { - Ok(GeneratedField::CreatorAddress) - } - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryContractsByCreatorRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.QueryContractsByCreatorRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut creator_address__ = None; - let mut pagination__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::CreatorAddress => { - if creator_address__.is_some() { - return Err(serde::de::Error::duplicate_field("creatorAddress")); - } - creator_address__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - } - } - Ok(QueryContractsByCreatorRequest { - creator_address: creator_address__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.QueryContractsByCreatorRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryContractsByCreatorResponse { - #[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_addresses.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmwasm.wasm.v1.QueryContractsByCreatorResponse", len)?; - if !self.contract_addresses.is_empty() { - struct_ser.serialize_field("contractAddresses", &self.contract_addresses)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryContractsByCreatorResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["contract_addresses", "contractAddresses", "pagination"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ContractAddresses, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "contractAddresses" | "contract_addresses" => { - Ok(GeneratedField::ContractAddresses) - } - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryContractsByCreatorResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.QueryContractsByCreatorResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut contract_addresses__ = None; - let mut pagination__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ContractAddresses => { - if contract_addresses__.is_some() { - return Err(serde::de::Error::duplicate_field("contractAddresses")); - } - contract_addresses__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - } - } - Ok(QueryContractsByCreatorResponse { - contract_addresses: contract_addresses__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.QueryContractsByCreatorResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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() - } -} -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 {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser.serialize_field( - "queryData", - pbjson::private::base64::encode(&self.query_data).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryRawContractStateRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["address", "query_data", "queryData"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Address, - QueryData, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryRawContractStateResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["data"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Data, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser.serialize_field( - "queryData", - pbjson::private::base64::encode(&self.query_data).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QuerySmartContractStateRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["address", "query_data", "queryData"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Address, - QueryData, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QuerySmartContractStateResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["data"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Data, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() { - struct_ser.serialize_field( - "idKey", - pbjson::private::base64::encode(&self.id_key).as_str(), - )?; - } - if self.value != 0 { - struct_ser.serialize_field("value", ToString::to_string(&self.value).as_str())?; - } - struct_ser.end() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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) - } -} -impl serde::Serialize for StoreAndInstantiateContractProposal { - #[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; - } - if !self.admin.is_empty() { - 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.source.is_empty() { - len += 1; - } - if !self.builder.is_empty() { - len += 1; - } - if !self.code_hash.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("cosmwasm.wasm.v1.StoreAndInstantiateContractProposal", 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() { - 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)?; - } - 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 !self.msg.is_empty() { - 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.source.is_empty() { - struct_ser.serialize_field("source", &self.source)?; - } - if !self.builder.is_empty() { - struct_ser.serialize_field("builder", &self.builder)?; - } - if !self.code_hash.is_empty() { - struct_ser.serialize_field( - "codeHash", - pbjson::private::base64::encode(&self.code_hash).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for StoreAndInstantiateContractProposal { - #[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", - "admin", - "label", - "msg", - "funds", - "source", - "builder", - "code_hash", - "codeHash", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Title, - Description, - RunAs, - WasmByteCode, - InstantiatePermission, - UnpinCode, - Admin, - Label, - Msg, - Funds, - Source, - Builder, - CodeHash, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "admin" => Ok(GeneratedField::Admin), - "label" => Ok(GeneratedField::Label), - "msg" => Ok(GeneratedField::Msg), - "funds" => Ok(GeneratedField::Funds), - "source" => Ok(GeneratedField::Source), - "builder" => Ok(GeneratedField::Builder), - "codeHash" | "code_hash" => Ok(GeneratedField::CodeHash), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StoreAndInstantiateContractProposal; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.StoreAndInstantiateContractProposal") - } - - 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; - let mut admin__ = None; - let mut label__ = None; - let mut msg__ = None; - let mut funds__ = None; - let mut source__ = None; - let mut builder__ = None; - let mut code_hash__ = 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()?); - } - 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::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::Source => { - if source__.is_some() { - return Err(serde::de::Error::duplicate_field("source")); - } - source__ = Some(map.next_value()?); - } - GeneratedField::Builder => { - if builder__.is_some() { - return Err(serde::de::Error::duplicate_field("builder")); - } - builder__ = Some(map.next_value()?); - } - 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, - ); - } - } - } - Ok(StoreAndInstantiateContractProposal { - 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(), - admin: admin__.unwrap_or_default(), - label: label__.unwrap_or_default(), - msg: msg__.unwrap_or_default(), - funds: funds__.unwrap_or_default(), - source: source__.unwrap_or_default(), - builder: builder__.unwrap_or_default(), - code_hash: code_hash__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.StoreAndInstantiateContractProposal", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for StoreCodeAuthorization { - #[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; - } - let mut struct_ser = - serializer.serialize_struct("cosmwasm.wasm.v1.StoreCodeAuthorization", len)?; - if !self.grants.is_empty() { - struct_ser.serialize_field("grants", &self.grants)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for StoreCodeAuthorization { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["grants"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Grants, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StoreCodeAuthorization; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmwasm.wasm.v1.StoreCodeAuthorization") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut grants__ = 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()?); - } - } - } - Ok(StoreCodeAuthorization { - grants: grants__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.StoreCodeAuthorization", - FIELDS, - GeneratedVisitor, - ) - } -} -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; - } - if !self.source.is_empty() { - len += 1; - } - if !self.builder.is_empty() { - len += 1; - } - if !self.code_hash.is_empty() { - 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() { - 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)?; - } - if !self.source.is_empty() { - struct_ser.serialize_field("source", &self.source)?; - } - if !self.builder.is_empty() { - struct_ser.serialize_field("builder", &self.builder)?; - } - if !self.code_hash.is_empty() { - struct_ser.serialize_field( - "codeHash", - pbjson::private::base64::encode(&self.code_hash).as_str(), - )?; - } - struct_ser.end() - } -} -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", - "source", - "builder", - "code_hash", - "codeHash", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Title, - Description, - RunAs, - WasmByteCode, - InstantiatePermission, - UnpinCode, - Source, - Builder, - CodeHash, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "source" => Ok(GeneratedField::Source), - "builder" => Ok(GeneratedField::Builder), - "codeHash" | "code_hash" => Ok(GeneratedField::CodeHash), - _ => 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; - let mut source__ = None; - let mut builder__ = None; - let mut code_hash__ = 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()?); - } - GeneratedField::Source => { - if source__.is_some() { - return Err(serde::de::Error::duplicate_field("source")); - } - source__ = Some(map.next_value()?); - } - GeneratedField::Builder => { - if builder__.is_some() { - return Err(serde::de::Error::duplicate_field("builder")); - } - builder__ = Some(map.next_value()?); - } - 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, - ); - } - } - } - 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(), - source: source__.unwrap_or_default(), - builder: builder__.unwrap_or_default(), - code_hash: code_hash__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmwasm.wasm.v1.StoreCodeProposal", - FIELDS, - GeneratedVisitor, - ) - } -} -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() { - struct_ser - .serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SudoContractProposal { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> 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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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, - ) - } -} -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() - } -} -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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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/packages/proto/src/gen/ibc.applications.fee.v1.rs b/packages/proto/src/gen/ibc.applications.fee.v1.rs index 3b5d37f..41e02f8 100644 --- a/packages/proto/src/gen/ibc.applications.fee.v1.rs +++ b/packages/proto/src/gen/ibc.applications.fee.v1.rs @@ -1,5 +1,6 @@ // @generated /// IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IncentivizedAcknowledgement { @@ -21,6 +22,7 @@ impl ::prost::Name for IncentivizedAcknowledgement { } } /// Fee defines the ICS29 receive, acknowledgement and timeout fees +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Fee { @@ -43,6 +45,7 @@ impl ::prost::Name for Fee { } } /// PacketFee contains ICS29 relayer fees, refund address and optional list of permitted relayers +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PacketFee { @@ -64,6 +67,7 @@ impl ::prost::Name for PacketFee { } } /// PacketFees contains a list of type PacketFee +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PacketFees { @@ -79,6 +83,7 @@ impl ::prost::Name for PacketFees { } } /// IdentifiedPacketFees contains a list of type PacketFee and associated PacketId +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IdentifiedPacketFees { @@ -97,6 +102,7 @@ impl ::prost::Name for IdentifiedPacketFees { } } /// GenesisState defines the ICS29 fee middleware genesis state +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -124,6 +130,7 @@ impl ::prost::Name for GenesisState { } } /// FeeEnabledChannel contains the PortID & ChannelID for a fee enabled channel +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FeeEnabledChannel { @@ -142,6 +149,7 @@ impl ::prost::Name for FeeEnabledChannel { } } /// RegisteredPayee contains the relayer address and payee address for a specific channel +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegisteredPayee { @@ -164,6 +172,7 @@ impl ::prost::Name for RegisteredPayee { } /// RegisteredCounterpartyPayee contains the relayer address and counterparty payee address for a specific channel (used /// for recv fee distribution) +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegisteredCounterpartyPayee { @@ -185,6 +194,7 @@ impl ::prost::Name for RegisteredCounterpartyPayee { } } /// ForwardRelayerAddress contains the forward relayer address and PacketId used for async acknowledgements +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ForwardRelayerAddress { @@ -204,6 +214,7 @@ impl ::prost::Name for ForwardRelayerAddress { } /// Metadata defines the ICS29 channel specific metadata encoded into the channel version bytestring /// See ICS004: +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Metadata { @@ -222,6 +233,7 @@ impl ::prost::Name for Metadata { } } /// QueryIncentivizedPacketsRequest defines the request type for the IncentivizedPackets rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryIncentivizedPacketsRequest { @@ -242,6 +254,7 @@ impl ::prost::Name for QueryIncentivizedPacketsRequest { } } /// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryIncentivizedPacketsResponse { @@ -257,6 +270,7 @@ impl ::prost::Name for QueryIncentivizedPacketsResponse { } } /// QueryIncentivizedPacketRequest defines the request type for the IncentivizedPacket rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryIncentivizedPacketRequest { @@ -275,6 +289,7 @@ impl ::prost::Name for QueryIncentivizedPacketRequest { } } /// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPacket rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryIncentivizedPacketResponse { @@ -291,6 +306,7 @@ impl ::prost::Name for QueryIncentivizedPacketResponse { } /// QueryIncentivizedPacketsForChannelRequest defines the request type for querying for all incentivized packets /// for a specific channel +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryIncentivizedPacketsForChannelRequest { @@ -315,6 +331,7 @@ impl ::prost::Name for QueryIncentivizedPacketsForChannelRequest { } } /// QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryIncentivizedPacketsForChannelResponse { @@ -330,6 +347,7 @@ impl ::prost::Name for QueryIncentivizedPacketsForChannelResponse { } } /// QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalRecvFeesRequest { @@ -345,6 +363,7 @@ impl ::prost::Name for QueryTotalRecvFeesRequest { } } /// QueryTotalRecvFeesResponse defines the response type for the TotalRecvFees rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalRecvFeesResponse { @@ -361,6 +380,7 @@ impl ::prost::Name for QueryTotalRecvFeesResponse { } } /// QueryTotalAckFeesRequest defines the request type for the TotalAckFees rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalAckFeesRequest { @@ -376,6 +396,7 @@ impl ::prost::Name for QueryTotalAckFeesRequest { } } /// QueryTotalAckFeesResponse defines the response type for the TotalAckFees rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalAckFeesResponse { @@ -391,6 +412,7 @@ impl ::prost::Name for QueryTotalAckFeesResponse { } } /// QueryTotalTimeoutFeesRequest defines the request type for the TotalTimeoutFees rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalTimeoutFeesRequest { @@ -406,6 +428,7 @@ impl ::prost::Name for QueryTotalTimeoutFeesRequest { } } /// QueryTotalTimeoutFeesResponse defines the response type for the TotalTimeoutFees rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalTimeoutFeesResponse { @@ -422,6 +445,7 @@ impl ::prost::Name for QueryTotalTimeoutFeesResponse { } } /// QueryPayeeRequest defines the request type for the Payee rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPayeeRequest { @@ -440,6 +464,7 @@ impl ::prost::Name for QueryPayeeRequest { } } /// QueryPayeeResponse defines the response type for the Payee rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPayeeResponse { @@ -455,6 +480,7 @@ impl ::prost::Name for QueryPayeeResponse { } } /// QueryCounterpartyPayeeRequest defines the request type for the CounterpartyPayee rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCounterpartyPayeeRequest { @@ -473,6 +499,7 @@ impl ::prost::Name for QueryCounterpartyPayeeRequest { } } /// QueryCounterpartyPayeeResponse defines the response type for the CounterpartyPayee rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCounterpartyPayeeResponse { @@ -488,6 +515,7 @@ impl ::prost::Name for QueryCounterpartyPayeeResponse { } } /// QueryFeeEnabledChannelsRequest defines the request type for the FeeEnabledChannels rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryFeeEnabledChannelsRequest { @@ -508,6 +536,7 @@ impl ::prost::Name for QueryFeeEnabledChannelsRequest { } } /// QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryFeeEnabledChannelsResponse { @@ -523,6 +552,7 @@ impl ::prost::Name for QueryFeeEnabledChannelsResponse { } } /// QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryFeeEnabledChannelRequest { @@ -541,6 +571,7 @@ impl ::prost::Name for QueryFeeEnabledChannelRequest { } } /// QueryFeeEnabledChannelResponse defines the response type for the FeeEnabledChannel rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryFeeEnabledChannelResponse { @@ -556,6 +587,7 @@ impl ::prost::Name for QueryFeeEnabledChannelResponse { } } /// MsgRegisterPayee defines the request type for the RegisterPayee rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRegisterPayee { @@ -580,6 +612,7 @@ impl ::prost::Name for MsgRegisterPayee { } } /// MsgRegisterPayeeResponse defines the response type for the RegisterPayee rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRegisterPayeeResponse {} @@ -591,6 +624,7 @@ impl ::prost::Name for MsgRegisterPayeeResponse { } } /// MsgRegisterCounterpartyPayee defines the request type for the RegisterCounterpartyPayee rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRegisterCounterpartyPayee { @@ -615,6 +649,7 @@ impl ::prost::Name for MsgRegisterCounterpartyPayee { } } /// MsgRegisterCounterpartyPayeeResponse defines the response type for the RegisterCounterpartyPayee rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRegisterCounterpartyPayeeResponse {} @@ -628,6 +663,7 @@ impl ::prost::Name for MsgRegisterCounterpartyPayeeResponse { /// MsgPayPacketFee defines the request type for the PayPacketFee rpc /// This Msg can be used to pay for a packet at the next sequence send & should be combined with the Msg that will be /// paid for +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgPayPacketFee { @@ -655,6 +691,7 @@ impl ::prost::Name for MsgPayPacketFee { } } /// MsgPayPacketFeeResponse defines the response type for the PayPacketFee rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgPayPacketFeeResponse {} @@ -667,6 +704,7 @@ impl ::prost::Name for MsgPayPacketFeeResponse { } /// MsgPayPacketFeeAsync defines the request type for the PayPacketFeeAsync rpc /// This Msg can be used to pay for a packet at a specified sequence (instead of the next sequence send) +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgPayPacketFeeAsync { @@ -685,6 +723,7 @@ impl ::prost::Name for MsgPayPacketFeeAsync { } } /// MsgPayPacketFeeAsyncResponse defines the response type for the PayPacketFeeAsync rpc +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgPayPacketFeeAsyncResponse {} @@ -2512,6 +2551,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x63, 0x20, 0x72, 0x70, 0x63, 0x0a, 0x0a, 0x0a, 0x0a, 0x03, 0x04, 0x07, 0x01, 0x12, 0x03, 0x6f, 0x08, 0x24, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("ibc.applications.fee.v1.serde.rs"); include!("ibc.applications.fee.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/ibc.applications.fee.v1.serde.rs b/packages/proto/src/gen/ibc.applications.fee.v1.serde.rs deleted file mode 100644 index f090b36..0000000 --- a/packages/proto/src/gen/ibc.applications.fee.v1.serde.rs +++ /dev/null @@ -1,4559 +0,0 @@ -// @generated -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.recv_fee.is_empty() { - len += 1; - } - if !self.ack_fee.is_empty() { - len += 1; - } - if !self.timeout_fee.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("ibc.applications.fee.v1.Fee", len)?; - if !self.recv_fee.is_empty() { - struct_ser.serialize_field("recvFee", &self.recv_fee)?; - } - if !self.ack_fee.is_empty() { - struct_ser.serialize_field("ackFee", &self.ack_fee)?; - } - if !self.timeout_fee.is_empty() { - struct_ser.serialize_field("timeoutFee", &self.timeout_fee)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Fee { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "recv_fee", - "recvFee", - "ack_fee", - "ackFee", - "timeout_fee", - "timeoutFee", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - RecvFee, - AckFee, - TimeoutFee, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "recvFee" | "recv_fee" => Ok(GeneratedField::RecvFee), - "ackFee" | "ack_fee" => Ok(GeneratedField::AckFee), - "timeoutFee" | "timeout_fee" => Ok(GeneratedField::TimeoutFee), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Fee; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.Fee") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut recv_fee__ = None; - let mut ack_fee__ = None; - let mut timeout_fee__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::RecvFee => { - if recv_fee__.is_some() { - return Err(serde::de::Error::duplicate_field("recvFee")); - } - recv_fee__ = Some(map.next_value()?); - } - GeneratedField::AckFee => { - if ack_fee__.is_some() { - return Err(serde::de::Error::duplicate_field("ackFee")); - } - ack_fee__ = Some(map.next_value()?); - } - GeneratedField::TimeoutFee => { - if timeout_fee__.is_some() { - return Err(serde::de::Error::duplicate_field("timeoutFee")); - } - timeout_fee__ = Some(map.next_value()?); - } - } - } - Ok(Fee { - recv_fee: recv_fee__.unwrap_or_default(), - ack_fee: ack_fee__.unwrap_or_default(), - timeout_fee: timeout_fee__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("ibc.applications.fee.v1.Fee", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for FeeEnabledChannel { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.fee.v1.FeeEnabledChannel", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for FeeEnabledChannel { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = FeeEnabledChannel; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.FeeEnabledChannel") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - } - } - Ok(FeeEnabledChannel { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.FeeEnabledChannel", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ForwardRelayerAddress { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.address.is_empty() { - len += 1; - } - if self.packet_id.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.fee.v1.ForwardRelayerAddress", len)?; - if !self.address.is_empty() { - struct_ser.serialize_field("address", &self.address)?; - } - if let Some(v) = self.packet_id.as_ref() { - struct_ser.serialize_field("packetId", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ForwardRelayerAddress { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["address", "packet_id", "packetId"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Address, - PacketId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "packetId" | "packet_id" => Ok(GeneratedField::PacketId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ForwardRelayerAddress; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.ForwardRelayerAddress") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut address__ = None; - let mut packet_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Address => { - if address__.is_some() { - return Err(serde::de::Error::duplicate_field("address")); - } - address__ = Some(map.next_value()?); - } - GeneratedField::PacketId => { - if packet_id__.is_some() { - return Err(serde::de::Error::duplicate_field("packetId")); - } - packet_id__ = map.next_value()?; - } - } - } - Ok(ForwardRelayerAddress { - address: address__.unwrap_or_default(), - packet_id: packet_id__, - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.ForwardRelayerAddress", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for GenesisState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.identified_fees.is_empty() { - len += 1; - } - if !self.fee_enabled_channels.is_empty() { - len += 1; - } - if !self.registered_payees.is_empty() { - len += 1; - } - if !self.registered_counterparty_payees.is_empty() { - len += 1; - } - if !self.forward_relayers.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.fee.v1.GenesisState", len)?; - if !self.identified_fees.is_empty() { - struct_ser.serialize_field("identifiedFees", &self.identified_fees)?; - } - if !self.fee_enabled_channels.is_empty() { - struct_ser.serialize_field("feeEnabledChannels", &self.fee_enabled_channels)?; - } - if !self.registered_payees.is_empty() { - struct_ser.serialize_field("registeredPayees", &self.registered_payees)?; - } - if !self.registered_counterparty_payees.is_empty() { - struct_ser.serialize_field( - "registeredCounterpartyPayees", - &self.registered_counterparty_payees, - )?; - } - if !self.forward_relayers.is_empty() { - struct_ser.serialize_field("forwardRelayers", &self.forward_relayers)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GenesisState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "identified_fees", - "identifiedFees", - "fee_enabled_channels", - "feeEnabledChannels", - "registered_payees", - "registeredPayees", - "registered_counterparty_payees", - "registeredCounterpartyPayees", - "forward_relayers", - "forwardRelayers", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - IdentifiedFees, - FeeEnabledChannels, - RegisteredPayees, - RegisteredCounterpartyPayees, - ForwardRelayers, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "identifiedFees" | "identified_fees" => { - Ok(GeneratedField::IdentifiedFees) - } - "feeEnabledChannels" | "fee_enabled_channels" => { - Ok(GeneratedField::FeeEnabledChannels) - } - "registeredPayees" | "registered_payees" => { - Ok(GeneratedField::RegisteredPayees) - } - "registeredCounterpartyPayees" | "registered_counterparty_payees" => { - Ok(GeneratedField::RegisteredCounterpartyPayees) - } - "forwardRelayers" | "forward_relayers" => { - Ok(GeneratedField::ForwardRelayers) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GenesisState; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.GenesisState") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut identified_fees__ = None; - let mut fee_enabled_channels__ = None; - let mut registered_payees__ = None; - let mut registered_counterparty_payees__ = None; - let mut forward_relayers__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::IdentifiedFees => { - if identified_fees__.is_some() { - return Err(serde::de::Error::duplicate_field("identifiedFees")); - } - identified_fees__ = Some(map.next_value()?); - } - GeneratedField::FeeEnabledChannels => { - if fee_enabled_channels__.is_some() { - return Err(serde::de::Error::duplicate_field( - "feeEnabledChannels", - )); - } - fee_enabled_channels__ = Some(map.next_value()?); - } - GeneratedField::RegisteredPayees => { - if registered_payees__.is_some() { - return Err(serde::de::Error::duplicate_field("registeredPayees")); - } - registered_payees__ = Some(map.next_value()?); - } - GeneratedField::RegisteredCounterpartyPayees => { - if registered_counterparty_payees__.is_some() { - return Err(serde::de::Error::duplicate_field( - "registeredCounterpartyPayees", - )); - } - registered_counterparty_payees__ = Some(map.next_value()?); - } - GeneratedField::ForwardRelayers => { - if forward_relayers__.is_some() { - return Err(serde::de::Error::duplicate_field("forwardRelayers")); - } - forward_relayers__ = Some(map.next_value()?); - } - } - } - Ok(GenesisState { - identified_fees: identified_fees__.unwrap_or_default(), - fee_enabled_channels: fee_enabled_channels__.unwrap_or_default(), - registered_payees: registered_payees__.unwrap_or_default(), - registered_counterparty_payees: registered_counterparty_payees__ - .unwrap_or_default(), - forward_relayers: forward_relayers__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.GenesisState", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for IdentifiedPacketFees { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.packet_id.is_some() { - len += 1; - } - if !self.packet_fees.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.fee.v1.IdentifiedPacketFees", len)?; - if let Some(v) = self.packet_id.as_ref() { - struct_ser.serialize_field("packetId", v)?; - } - if !self.packet_fees.is_empty() { - struct_ser.serialize_field("packetFees", &self.packet_fees)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for IdentifiedPacketFees { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["packet_id", "packetId", "packet_fees", "packetFees"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PacketId, - PacketFees, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "packetId" | "packet_id" => Ok(GeneratedField::PacketId), - "packetFees" | "packet_fees" => Ok(GeneratedField::PacketFees), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IdentifiedPacketFees; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.IdentifiedPacketFees") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut packet_id__ = None; - let mut packet_fees__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PacketId => { - if packet_id__.is_some() { - return Err(serde::de::Error::duplicate_field("packetId")); - } - packet_id__ = map.next_value()?; - } - GeneratedField::PacketFees => { - if packet_fees__.is_some() { - return Err(serde::de::Error::duplicate_field("packetFees")); - } - packet_fees__ = Some(map.next_value()?); - } - } - } - Ok(IdentifiedPacketFees { - packet_id: packet_id__, - packet_fees: packet_fees__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.IdentifiedPacketFees", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for IncentivizedAcknowledgement { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.app_acknowledgement.is_empty() { - len += 1; - } - if !self.forward_relayer_address.is_empty() { - len += 1; - } - if self.underlying_app_success { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.applications.fee.v1.IncentivizedAcknowledgement", len)?; - if !self.app_acknowledgement.is_empty() { - struct_ser.serialize_field( - "appAcknowledgement", - pbjson::private::base64::encode(&self.app_acknowledgement).as_str(), - )?; - } - if !self.forward_relayer_address.is_empty() { - struct_ser.serialize_field("forwardRelayerAddress", &self.forward_relayer_address)?; - } - if self.underlying_app_success { - struct_ser.serialize_field("underlyingAppSuccess", &self.underlying_app_success)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for IncentivizedAcknowledgement { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "app_acknowledgement", - "appAcknowledgement", - "forward_relayer_address", - "forwardRelayerAddress", - "underlying_app_success", - "underlyingAppSuccess", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - AppAcknowledgement, - ForwardRelayerAddress, - UnderlyingAppSuccess, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "appAcknowledgement" | "app_acknowledgement" => { - Ok(GeneratedField::AppAcknowledgement) - } - "forwardRelayerAddress" | "forward_relayer_address" => { - Ok(GeneratedField::ForwardRelayerAddress) - } - "underlyingAppSuccess" | "underlying_app_success" => { - Ok(GeneratedField::UnderlyingAppSuccess) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IncentivizedAcknowledgement; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.IncentivizedAcknowledgement") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut app_acknowledgement__ = None; - let mut forward_relayer_address__ = None; - let mut underlying_app_success__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::AppAcknowledgement => { - if app_acknowledgement__.is_some() { - return Err(serde::de::Error::duplicate_field( - "appAcknowledgement", - )); - } - app_acknowledgement__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ForwardRelayerAddress => { - if forward_relayer_address__.is_some() { - return Err(serde::de::Error::duplicate_field( - "forwardRelayerAddress", - )); - } - forward_relayer_address__ = Some(map.next_value()?); - } - GeneratedField::UnderlyingAppSuccess => { - if underlying_app_success__.is_some() { - return Err(serde::de::Error::duplicate_field( - "underlyingAppSuccess", - )); - } - underlying_app_success__ = Some(map.next_value()?); - } - } - } - Ok(IncentivizedAcknowledgement { - app_acknowledgement: app_acknowledgement__.unwrap_or_default(), - forward_relayer_address: forward_relayer_address__.unwrap_or_default(), - underlying_app_success: underlying_app_success__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.IncentivizedAcknowledgement", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for Metadata { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.fee_version.is_empty() { - len += 1; - } - if !self.app_version.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.fee.v1.Metadata", len)?; - if !self.fee_version.is_empty() { - struct_ser.serialize_field("feeVersion", &self.fee_version)?; - } - if !self.app_version.is_empty() { - struct_ser.serialize_field("appVersion", &self.app_version)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Metadata { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["fee_version", "feeVersion", "app_version", "appVersion"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - FeeVersion, - AppVersion, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "feeVersion" | "fee_version" => Ok(GeneratedField::FeeVersion), - "appVersion" | "app_version" => Ok(GeneratedField::AppVersion), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Metadata; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.Metadata") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut fee_version__ = None; - let mut app_version__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::FeeVersion => { - if fee_version__.is_some() { - return Err(serde::de::Error::duplicate_field("feeVersion")); - } - fee_version__ = Some(map.next_value()?); - } - GeneratedField::AppVersion => { - if app_version__.is_some() { - return Err(serde::de::Error::duplicate_field("appVersion")); - } - app_version__ = Some(map.next_value()?); - } - } - } - Ok(Metadata { - fee_version: fee_version__.unwrap_or_default(), - app_version: app_version__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.Metadata", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgPayPacketFee { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.fee.is_some() { - len += 1; - } - if !self.source_port_id.is_empty() { - len += 1; - } - if !self.source_channel_id.is_empty() { - len += 1; - } - if !self.signer.is_empty() { - len += 1; - } - if !self.relayers.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.fee.v1.MsgPayPacketFee", len)?; - if let Some(v) = self.fee.as_ref() { - struct_ser.serialize_field("fee", v)?; - } - if !self.source_port_id.is_empty() { - struct_ser.serialize_field("sourcePortId", &self.source_port_id)?; - } - if !self.source_channel_id.is_empty() { - struct_ser.serialize_field("sourceChannelId", &self.source_channel_id)?; - } - if !self.signer.is_empty() { - struct_ser.serialize_field("signer", &self.signer)?; - } - if !self.relayers.is_empty() { - struct_ser.serialize_field("relayers", &self.relayers)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgPayPacketFee { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "fee", - "source_port_id", - "sourcePortId", - "source_channel_id", - "sourceChannelId", - "signer", - "relayers", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Fee, - SourcePortId, - SourceChannelId, - Signer, - Relayers, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "fee" => Ok(GeneratedField::Fee), - "sourcePortId" | "source_port_id" => Ok(GeneratedField::SourcePortId), - "sourceChannelId" | "source_channel_id" => { - Ok(GeneratedField::SourceChannelId) - } - "signer" => Ok(GeneratedField::Signer), - "relayers" => Ok(GeneratedField::Relayers), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgPayPacketFee; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.MsgPayPacketFee") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut fee__ = None; - let mut source_port_id__ = None; - let mut source_channel_id__ = None; - let mut signer__ = None; - let mut relayers__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Fee => { - if fee__.is_some() { - return Err(serde::de::Error::duplicate_field("fee")); - } - fee__ = map.next_value()?; - } - GeneratedField::SourcePortId => { - if source_port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("sourcePortId")); - } - source_port_id__ = Some(map.next_value()?); - } - GeneratedField::SourceChannelId => { - if source_channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("sourceChannelId")); - } - source_channel_id__ = Some(map.next_value()?); - } - GeneratedField::Signer => { - if signer__.is_some() { - return Err(serde::de::Error::duplicate_field("signer")); - } - signer__ = Some(map.next_value()?); - } - GeneratedField::Relayers => { - if relayers__.is_some() { - return Err(serde::de::Error::duplicate_field("relayers")); - } - relayers__ = Some(map.next_value()?); - } - } - } - Ok(MsgPayPacketFee { - fee: fee__, - source_port_id: source_port_id__.unwrap_or_default(), - source_channel_id: source_channel_id__.unwrap_or_default(), - signer: signer__.unwrap_or_default(), - relayers: relayers__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.MsgPayPacketFee", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgPayPacketFeeAsync { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.packet_id.is_some() { - len += 1; - } - if self.packet_fee.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.fee.v1.MsgPayPacketFeeAsync", len)?; - if let Some(v) = self.packet_id.as_ref() { - struct_ser.serialize_field("packetId", v)?; - } - if let Some(v) = self.packet_fee.as_ref() { - struct_ser.serialize_field("packetFee", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgPayPacketFeeAsync { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["packet_id", "packetId", "packet_fee", "packetFee"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PacketId, - PacketFee, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "packetId" | "packet_id" => Ok(GeneratedField::PacketId), - "packetFee" | "packet_fee" => Ok(GeneratedField::PacketFee), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgPayPacketFeeAsync; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.MsgPayPacketFeeAsync") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut packet_id__ = None; - let mut packet_fee__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PacketId => { - if packet_id__.is_some() { - return Err(serde::de::Error::duplicate_field("packetId")); - } - packet_id__ = map.next_value()?; - } - GeneratedField::PacketFee => { - if packet_fee__.is_some() { - return Err(serde::de::Error::duplicate_field("packetFee")); - } - packet_fee__ = map.next_value()?; - } - } - } - Ok(MsgPayPacketFeeAsync { - packet_id: packet_id__, - packet_fee: packet_fee__, - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.MsgPayPacketFeeAsync", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgPayPacketFeeAsyncResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer - .serialize_struct("ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgPayPacketFeeAsyncResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgPayPacketFeeAsyncResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse") - } - - 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(MsgPayPacketFeeAsyncResponse {}) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgPayPacketFeeResponse { - #[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("ibc.applications.fee.v1.MsgPayPacketFeeResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgPayPacketFeeResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgPayPacketFeeResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.MsgPayPacketFeeResponse") - } - - 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(MsgPayPacketFeeResponse {}) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.MsgPayPacketFeeResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgRegisterCounterpartyPayee { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if !self.relayer.is_empty() { - len += 1; - } - if !self.counterparty_payee.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.applications.fee.v1.MsgRegisterCounterpartyPayee", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if !self.relayer.is_empty() { - struct_ser.serialize_field("relayer", &self.relayer)?; - } - if !self.counterparty_payee.is_empty() { - struct_ser.serialize_field("counterpartyPayee", &self.counterparty_payee)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgRegisterCounterpartyPayee { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "port_id", - "portId", - "channel_id", - "channelId", - "relayer", - "counterparty_payee", - "counterpartyPayee", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - Relayer, - CounterpartyPayee, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "relayer" => Ok(GeneratedField::Relayer), - "counterpartyPayee" | "counterparty_payee" => { - Ok(GeneratedField::CounterpartyPayee) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgRegisterCounterpartyPayee; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.MsgRegisterCounterpartyPayee") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut relayer__ = None; - let mut counterparty_payee__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::Relayer => { - if relayer__.is_some() { - return Err(serde::de::Error::duplicate_field("relayer")); - } - relayer__ = Some(map.next_value()?); - } - GeneratedField::CounterpartyPayee => { - if counterparty_payee__.is_some() { - return Err(serde::de::Error::duplicate_field("counterpartyPayee")); - } - counterparty_payee__ = Some(map.next_value()?); - } - } - } - Ok(MsgRegisterCounterpartyPayee { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - relayer: relayer__.unwrap_or_default(), - counterparty_payee: counterparty_payee__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.MsgRegisterCounterpartyPayee", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgRegisterCounterpartyPayeeResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct( - "ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse", - len, - )?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgRegisterCounterpartyPayeeResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgRegisterCounterpartyPayeeResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str( - "struct ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse", - ) - } - - 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(MsgRegisterCounterpartyPayeeResponse {}) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgRegisterPayee { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if !self.relayer.is_empty() { - len += 1; - } - if !self.payee.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.fee.v1.MsgRegisterPayee", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if !self.relayer.is_empty() { - struct_ser.serialize_field("relayer", &self.relayer)?; - } - if !self.payee.is_empty() { - struct_ser.serialize_field("payee", &self.payee)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgRegisterPayee { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "port_id", - "portId", - "channel_id", - "channelId", - "relayer", - "payee", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - Relayer, - Payee, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "relayer" => Ok(GeneratedField::Relayer), - "payee" => Ok(GeneratedField::Payee), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgRegisterPayee; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.MsgRegisterPayee") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut relayer__ = None; - let mut payee__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::Relayer => { - if relayer__.is_some() { - return Err(serde::de::Error::duplicate_field("relayer")); - } - relayer__ = Some(map.next_value()?); - } - GeneratedField::Payee => { - if payee__.is_some() { - return Err(serde::de::Error::duplicate_field("payee")); - } - payee__ = Some(map.next_value()?); - } - } - } - Ok(MsgRegisterPayee { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - relayer: relayer__.unwrap_or_default(), - payee: payee__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.MsgRegisterPayee", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgRegisterPayeeResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = - serializer.serialize_struct("ibc.applications.fee.v1.MsgRegisterPayeeResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgRegisterPayeeResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgRegisterPayeeResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.MsgRegisterPayeeResponse") - } - - 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(MsgRegisterPayeeResponse {}) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.MsgRegisterPayeeResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for PacketFee { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.fee.is_some() { - len += 1; - } - if !self.refund_address.is_empty() { - len += 1; - } - if !self.relayers.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.fee.v1.PacketFee", len)?; - if let Some(v) = self.fee.as_ref() { - struct_ser.serialize_field("fee", v)?; - } - if !self.refund_address.is_empty() { - struct_ser.serialize_field("refundAddress", &self.refund_address)?; - } - if !self.relayers.is_empty() { - struct_ser.serialize_field("relayers", &self.relayers)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PacketFee { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["fee", "refund_address", "refundAddress", "relayers"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Fee, - RefundAddress, - Relayers, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "fee" => Ok(GeneratedField::Fee), - "refundAddress" | "refund_address" => Ok(GeneratedField::RefundAddress), - "relayers" => Ok(GeneratedField::Relayers), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PacketFee; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.PacketFee") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut fee__ = None; - let mut refund_address__ = None; - let mut relayers__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Fee => { - if fee__.is_some() { - return Err(serde::de::Error::duplicate_field("fee")); - } - fee__ = map.next_value()?; - } - GeneratedField::RefundAddress => { - if refund_address__.is_some() { - return Err(serde::de::Error::duplicate_field("refundAddress")); - } - refund_address__ = Some(map.next_value()?); - } - GeneratedField::Relayers => { - if relayers__.is_some() { - return Err(serde::de::Error::duplicate_field("relayers")); - } - relayers__ = Some(map.next_value()?); - } - } - } - Ok(PacketFee { - fee: fee__, - refund_address: refund_address__.unwrap_or_default(), - relayers: relayers__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.PacketFee", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for PacketFees { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.packet_fees.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.fee.v1.PacketFees", len)?; - if !self.packet_fees.is_empty() { - struct_ser.serialize_field("packetFees", &self.packet_fees)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PacketFees { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["packet_fees", "packetFees"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PacketFees, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "packetFees" | "packet_fees" => Ok(GeneratedField::PacketFees), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PacketFees; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.PacketFees") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut packet_fees__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PacketFees => { - if packet_fees__.is_some() { - return Err(serde::de::Error::duplicate_field("packetFees")); - } - packet_fees__ = Some(map.next_value()?); - } - } - } - Ok(PacketFees { - packet_fees: packet_fees__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.PacketFees", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryCounterpartyPayeeRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.channel_id.is_empty() { - len += 1; - } - if !self.relayer.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.applications.fee.v1.QueryCounterpartyPayeeRequest", len)?; - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if !self.relayer.is_empty() { - struct_ser.serialize_field("relayer", &self.relayer)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryCounterpartyPayeeRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["channel_id", "channelId", "relayer"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ChannelId, - Relayer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "relayer" => Ok(GeneratedField::Relayer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryCounterpartyPayeeRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.QueryCounterpartyPayeeRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut channel_id__ = None; - let mut relayer__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::Relayer => { - if relayer__.is_some() { - return Err(serde::de::Error::duplicate_field("relayer")); - } - relayer__ = Some(map.next_value()?); - } - } - } - Ok(QueryCounterpartyPayeeRequest { - channel_id: channel_id__.unwrap_or_default(), - relayer: relayer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.QueryCounterpartyPayeeRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryCounterpartyPayeeResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.counterparty_payee.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.fee.v1.QueryCounterpartyPayeeResponse", - len, - )?; - if !self.counterparty_payee.is_empty() { - struct_ser.serialize_field("counterpartyPayee", &self.counterparty_payee)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryCounterpartyPayeeResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["counterparty_payee", "counterpartyPayee"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - CounterpartyPayee, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "counterpartyPayee" | "counterparty_payee" => { - Ok(GeneratedField::CounterpartyPayee) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryCounterpartyPayeeResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.QueryCounterpartyPayeeResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut counterparty_payee__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::CounterpartyPayee => { - if counterparty_payee__.is_some() { - return Err(serde::de::Error::duplicate_field("counterpartyPayee")); - } - counterparty_payee__ = Some(map.next_value()?); - } - } - } - Ok(QueryCounterpartyPayeeResponse { - counterparty_payee: counterparty_payee__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.QueryCounterpartyPayeeResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryFeeEnabledChannelRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.applications.fee.v1.QueryFeeEnabledChannelRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryFeeEnabledChannelRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryFeeEnabledChannelRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.QueryFeeEnabledChannelRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - } - } - Ok(QueryFeeEnabledChannelRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.QueryFeeEnabledChannelRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryFeeEnabledChannelResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.fee_enabled { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.fee.v1.QueryFeeEnabledChannelResponse", - len, - )?; - if self.fee_enabled { - struct_ser.serialize_field("feeEnabled", &self.fee_enabled)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryFeeEnabledChannelResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["fee_enabled", "feeEnabled"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - FeeEnabled, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "feeEnabled" | "fee_enabled" => Ok(GeneratedField::FeeEnabled), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryFeeEnabledChannelResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.QueryFeeEnabledChannelResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut fee_enabled__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::FeeEnabled => { - if fee_enabled__.is_some() { - return Err(serde::de::Error::duplicate_field("feeEnabled")); - } - fee_enabled__ = Some(map.next_value()?); - } - } - } - Ok(QueryFeeEnabledChannelResponse { - fee_enabled: fee_enabled__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.QueryFeeEnabledChannelResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryFeeEnabledChannelsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.pagination.is_some() { - len += 1; - } - if self.query_height != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest", - len, - )?; - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - if self.query_height != 0 { - struct_ser.serialize_field( - "queryHeight", - ToString::to_string(&self.query_height).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryFeeEnabledChannelsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["pagination", "query_height", "queryHeight"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Pagination, - QueryHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "queryHeight" | "query_height" => Ok(GeneratedField::QueryHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryFeeEnabledChannelsRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut pagination__ = None; - let mut query_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - GeneratedField::QueryHeight => { - if query_height__.is_some() { - return Err(serde::de::Error::duplicate_field("queryHeight")); - } - query_height__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(QueryFeeEnabledChannelsRequest { - pagination: pagination__, - query_height: query_height__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryFeeEnabledChannelsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.fee_enabled_channels.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse", - len, - )?; - if !self.fee_enabled_channels.is_empty() { - struct_ser.serialize_field("feeEnabledChannels", &self.fee_enabled_channels)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryFeeEnabledChannelsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["fee_enabled_channels", "feeEnabledChannels"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - FeeEnabledChannels, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "feeEnabledChannels" | "fee_enabled_channels" => { - Ok(GeneratedField::FeeEnabledChannels) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryFeeEnabledChannelsResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut fee_enabled_channels__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::FeeEnabledChannels => { - if fee_enabled_channels__.is_some() { - return Err(serde::de::Error::duplicate_field( - "feeEnabledChannels", - )); - } - fee_enabled_channels__ = Some(map.next_value()?); - } - } - } - Ok(QueryFeeEnabledChannelsResponse { - fee_enabled_channels: fee_enabled_channels__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryIncentivizedPacketRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.packet_id.is_some() { - len += 1; - } - if self.query_height != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.fee.v1.QueryIncentivizedPacketRequest", - len, - )?; - if let Some(v) = self.packet_id.as_ref() { - struct_ser.serialize_field("packetId", v)?; - } - if self.query_height != 0 { - struct_ser.serialize_field( - "queryHeight", - ToString::to_string(&self.query_height).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryIncentivizedPacketRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["packet_id", "packetId", "query_height", "queryHeight"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PacketId, - QueryHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "packetId" | "packet_id" => Ok(GeneratedField::PacketId), - "queryHeight" | "query_height" => Ok(GeneratedField::QueryHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryIncentivizedPacketRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.QueryIncentivizedPacketRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut packet_id__ = None; - let mut query_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PacketId => { - if packet_id__.is_some() { - return Err(serde::de::Error::duplicate_field("packetId")); - } - packet_id__ = map.next_value()?; - } - GeneratedField::QueryHeight => { - if query_height__.is_some() { - return Err(serde::de::Error::duplicate_field("queryHeight")); - } - query_height__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(QueryIncentivizedPacketRequest { - packet_id: packet_id__, - query_height: query_height__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.QueryIncentivizedPacketRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryIncentivizedPacketResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.incentivized_packet.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.fee.v1.QueryIncentivizedPacketResponse", - len, - )?; - if let Some(v) = self.incentivized_packet.as_ref() { - struct_ser.serialize_field("incentivizedPacket", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryIncentivizedPacketResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["incentivized_packet", "incentivizedPacket"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - IncentivizedPacket, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "incentivizedPacket" | "incentivized_packet" => { - Ok(GeneratedField::IncentivizedPacket) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryIncentivizedPacketResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct ibc.applications.fee.v1.QueryIncentivizedPacketResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut incentivized_packet__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::IncentivizedPacket => { - if incentivized_packet__.is_some() { - return Err(serde::de::Error::duplicate_field( - "incentivizedPacket", - )); - } - incentivized_packet__ = map.next_value()?; - } - } - } - Ok(QueryIncentivizedPacketResponse { - incentivized_packet: incentivized_packet__, - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.QueryIncentivizedPacketResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryIncentivizedPacketsForChannelRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.pagination.is_some() { - len += 1; - } - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if self.query_height != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest", - len, - )?; - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if self.query_height != 0 { - struct_ser.serialize_field( - "queryHeight", - ToString::to_string(&self.query_height).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryIncentivizedPacketsForChannelRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "pagination", - "port_id", - "portId", - "channel_id", - "channelId", - "query_height", - "queryHeight", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Pagination, - PortId, - ChannelId, - QueryHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "queryHeight" | "query_height" => Ok(GeneratedField::QueryHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryIncentivizedPacketsForChannelRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str( - "struct ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest", - ) - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut pagination__ = None; - let mut port_id__ = None; - let mut channel_id__ = None; - let mut query_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::QueryHeight => { - if query_height__.is_some() { - return Err(serde::de::Error::duplicate_field("queryHeight")); - } - query_height__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(QueryIncentivizedPacketsForChannelRequest { - pagination: pagination__, - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - query_height: query_height__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryIncentivizedPacketsForChannelResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.incentivized_packets.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse", - len, - )?; - if !self.incentivized_packets.is_empty() { - struct_ser.serialize_field("incentivizedPackets", &self.incentivized_packets)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryIncentivizedPacketsForChannelResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["incentivized_packets", "incentivizedPackets"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - IncentivizedPackets, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "incentivizedPackets" | "incentivized_packets" => { - Ok(GeneratedField::IncentivizedPackets) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryIncentivizedPacketsForChannelResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str( - "struct ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse", - ) - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut incentivized_packets__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::IncentivizedPackets => { - if incentivized_packets__.is_some() { - return Err(serde::de::Error::duplicate_field( - "incentivizedPackets", - )); - } - incentivized_packets__ = Some(map.next_value()?); - } - } - } - Ok(QueryIncentivizedPacketsForChannelResponse { - incentivized_packets: incentivized_packets__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryIncentivizedPacketsRequest { - #[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; - } - if self.query_height != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.fee.v1.QueryIncentivizedPacketsRequest", - len, - )?; - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - if self.query_height != 0 { - struct_ser.serialize_field( - "queryHeight", - ToString::to_string(&self.query_height).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryIncentivizedPacketsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["pagination", "query_height", "queryHeight"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Pagination, - QueryHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "queryHeight" | "query_height" => Ok(GeneratedField::QueryHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryIncentivizedPacketsRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct ibc.applications.fee.v1.QueryIncentivizedPacketsRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut pagination__ = None; - let mut query_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - GeneratedField::QueryHeight => { - if query_height__.is_some() { - return Err(serde::de::Error::duplicate_field("queryHeight")); - } - query_height__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(QueryIncentivizedPacketsRequest { - pagination: pagination__, - query_height: query_height__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.QueryIncentivizedPacketsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryIncentivizedPacketsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.incentivized_packets.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.fee.v1.QueryIncentivizedPacketsResponse", - len, - )?; - if !self.incentivized_packets.is_empty() { - struct_ser.serialize_field("incentivizedPackets", &self.incentivized_packets)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryIncentivizedPacketsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["incentivized_packets", "incentivizedPackets"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - IncentivizedPackets, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "incentivizedPackets" | "incentivized_packets" => { - Ok(GeneratedField::IncentivizedPackets) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryIncentivizedPacketsResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct ibc.applications.fee.v1.QueryIncentivizedPacketsResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut incentivized_packets__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::IncentivizedPackets => { - if incentivized_packets__.is_some() { - return Err(serde::de::Error::duplicate_field( - "incentivizedPackets", - )); - } - incentivized_packets__ = Some(map.next_value()?); - } - } - } - Ok(QueryIncentivizedPacketsResponse { - incentivized_packets: incentivized_packets__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.QueryIncentivizedPacketsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryPayeeRequest { - #[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_id.is_empty() { - len += 1; - } - if !self.relayer.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.fee.v1.QueryPayeeRequest", len)?; - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if !self.relayer.is_empty() { - struct_ser.serialize_field("relayer", &self.relayer)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryPayeeRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["channel_id", "channelId", "relayer"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ChannelId, - Relayer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "relayer" => Ok(GeneratedField::Relayer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPayeeRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.QueryPayeeRequest") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut channel_id__ = None; - let mut relayer__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::Relayer => { - if relayer__.is_some() { - return Err(serde::de::Error::duplicate_field("relayer")); - } - relayer__ = Some(map.next_value()?); - } - } - } - Ok(QueryPayeeRequest { - channel_id: channel_id__.unwrap_or_default(), - relayer: relayer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.QueryPayeeRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryPayeeResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.payee_address.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.fee.v1.QueryPayeeResponse", len)?; - if !self.payee_address.is_empty() { - struct_ser.serialize_field("payeeAddress", &self.payee_address)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryPayeeResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["payee_address", "payeeAddress"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PayeeAddress, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "payeeAddress" | "payee_address" => Ok(GeneratedField::PayeeAddress), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPayeeResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.QueryPayeeResponse") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut payee_address__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PayeeAddress => { - if payee_address__.is_some() { - return Err(serde::de::Error::duplicate_field("payeeAddress")); - } - payee_address__ = Some(map.next_value()?); - } - } - } - Ok(QueryPayeeResponse { - payee_address: payee_address__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.QueryPayeeResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryTotalAckFeesRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.packet_id.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.fee.v1.QueryTotalAckFeesRequest", len)?; - if let Some(v) = self.packet_id.as_ref() { - struct_ser.serialize_field("packetId", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryTotalAckFeesRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["packet_id", "packetId"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PacketId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "packetId" | "packet_id" => Ok(GeneratedField::PacketId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryTotalAckFeesRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.QueryTotalAckFeesRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut packet_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PacketId => { - if packet_id__.is_some() { - return Err(serde::de::Error::duplicate_field("packetId")); - } - packet_id__ = map.next_value()?; - } - } - } - Ok(QueryTotalAckFeesRequest { - packet_id: packet_id__, - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.QueryTotalAckFeesRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryTotalAckFeesResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.ack_fees.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.applications.fee.v1.QueryTotalAckFeesResponse", len)?; - if !self.ack_fees.is_empty() { - struct_ser.serialize_field("ackFees", &self.ack_fees)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryTotalAckFeesResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["ack_fees", "ackFees"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - AckFees, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "ackFees" | "ack_fees" => Ok(GeneratedField::AckFees), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryTotalAckFeesResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.QueryTotalAckFeesResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut ack_fees__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::AckFees => { - if ack_fees__.is_some() { - return Err(serde::de::Error::duplicate_field("ackFees")); - } - ack_fees__ = Some(map.next_value()?); - } - } - } - Ok(QueryTotalAckFeesResponse { - ack_fees: ack_fees__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.QueryTotalAckFeesResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryTotalRecvFeesRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.packet_id.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.applications.fee.v1.QueryTotalRecvFeesRequest", len)?; - if let Some(v) = self.packet_id.as_ref() { - struct_ser.serialize_field("packetId", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryTotalRecvFeesRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["packet_id", "packetId"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PacketId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "packetId" | "packet_id" => Ok(GeneratedField::PacketId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryTotalRecvFeesRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.QueryTotalRecvFeesRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut packet_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PacketId => { - if packet_id__.is_some() { - return Err(serde::de::Error::duplicate_field("packetId")); - } - packet_id__ = map.next_value()?; - } - } - } - Ok(QueryTotalRecvFeesRequest { - packet_id: packet_id__, - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.QueryTotalRecvFeesRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryTotalRecvFeesResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.recv_fees.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.applications.fee.v1.QueryTotalRecvFeesResponse", len)?; - if !self.recv_fees.is_empty() { - struct_ser.serialize_field("recvFees", &self.recv_fees)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryTotalRecvFeesResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["recv_fees", "recvFees"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - RecvFees, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "recvFees" | "recv_fees" => Ok(GeneratedField::RecvFees), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryTotalRecvFeesResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.QueryTotalRecvFeesResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut recv_fees__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::RecvFees => { - if recv_fees__.is_some() { - return Err(serde::de::Error::duplicate_field("recvFees")); - } - recv_fees__ = Some(map.next_value()?); - } - } - } - Ok(QueryTotalRecvFeesResponse { - recv_fees: recv_fees__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.QueryTotalRecvFeesResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryTotalTimeoutFeesRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.packet_id.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest", len)?; - if let Some(v) = self.packet_id.as_ref() { - struct_ser.serialize_field("packetId", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryTotalTimeoutFeesRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["packet_id", "packetId"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PacketId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "packetId" | "packet_id" => Ok(GeneratedField::PacketId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryTotalTimeoutFeesRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut packet_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PacketId => { - if packet_id__.is_some() { - return Err(serde::de::Error::duplicate_field("packetId")); - } - packet_id__ = map.next_value()?; - } - } - } - Ok(QueryTotalTimeoutFeesRequest { - packet_id: packet_id__, - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryTotalTimeoutFeesResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.timeout_fees.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse", len)?; - if !self.timeout_fees.is_empty() { - struct_ser.serialize_field("timeoutFees", &self.timeout_fees)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryTotalTimeoutFeesResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["timeout_fees", "timeoutFees"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - TimeoutFees, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "timeoutFees" | "timeout_fees" => Ok(GeneratedField::TimeoutFees), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryTotalTimeoutFeesResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut timeout_fees__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::TimeoutFees => { - if timeout_fees__.is_some() { - return Err(serde::de::Error::duplicate_field("timeoutFees")); - } - timeout_fees__ = Some(map.next_value()?); - } - } - } - Ok(QueryTotalTimeoutFeesResponse { - timeout_fees: timeout_fees__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for RegisteredCounterpartyPayee { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.channel_id.is_empty() { - len += 1; - } - if !self.relayer.is_empty() { - len += 1; - } - if !self.counterparty_payee.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.applications.fee.v1.RegisteredCounterpartyPayee", len)?; - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if !self.relayer.is_empty() { - struct_ser.serialize_field("relayer", &self.relayer)?; - } - if !self.counterparty_payee.is_empty() { - struct_ser.serialize_field("counterpartyPayee", &self.counterparty_payee)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for RegisteredCounterpartyPayee { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "channel_id", - "channelId", - "relayer", - "counterparty_payee", - "counterpartyPayee", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ChannelId, - Relayer, - CounterpartyPayee, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "relayer" => Ok(GeneratedField::Relayer), - "counterpartyPayee" | "counterparty_payee" => { - Ok(GeneratedField::CounterpartyPayee) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RegisteredCounterpartyPayee; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.RegisteredCounterpartyPayee") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut channel_id__ = None; - let mut relayer__ = None; - let mut counterparty_payee__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::Relayer => { - if relayer__.is_some() { - return Err(serde::de::Error::duplicate_field("relayer")); - } - relayer__ = Some(map.next_value()?); - } - GeneratedField::CounterpartyPayee => { - if counterparty_payee__.is_some() { - return Err(serde::de::Error::duplicate_field("counterpartyPayee")); - } - counterparty_payee__ = Some(map.next_value()?); - } - } - } - Ok(RegisteredCounterpartyPayee { - channel_id: channel_id__.unwrap_or_default(), - relayer: relayer__.unwrap_or_default(), - counterparty_payee: counterparty_payee__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.RegisteredCounterpartyPayee", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for RegisteredPayee { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.channel_id.is_empty() { - len += 1; - } - if !self.relayer.is_empty() { - len += 1; - } - if !self.payee.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.fee.v1.RegisteredPayee", len)?; - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if !self.relayer.is_empty() { - struct_ser.serialize_field("relayer", &self.relayer)?; - } - if !self.payee.is_empty() { - struct_ser.serialize_field("payee", &self.payee)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for RegisteredPayee { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["channel_id", "channelId", "relayer", "payee"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ChannelId, - Relayer, - Payee, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "relayer" => Ok(GeneratedField::Relayer), - "payee" => Ok(GeneratedField::Payee), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RegisteredPayee; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.fee.v1.RegisteredPayee") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut channel_id__ = None; - let mut relayer__ = None; - let mut payee__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::Relayer => { - if relayer__.is_some() { - return Err(serde::de::Error::duplicate_field("relayer")); - } - relayer__ = Some(map.next_value()?); - } - GeneratedField::Payee => { - if payee__.is_some() { - return Err(serde::de::Error::duplicate_field("payee")); - } - payee__ = Some(map.next_value()?); - } - } - } - Ok(RegisteredPayee { - channel_id: channel_id__.unwrap_or_default(), - relayer: relayer__.unwrap_or_default(), - payee: payee__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.fee.v1.RegisteredPayee", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/ibc.applications.interchain_accounts.controller.v1.rs b/packages/proto/src/gen/ibc.applications.interchain_accounts.controller.v1.rs index e0fc154..c2d50ed 100644 --- a/packages/proto/src/gen/ibc.applications.interchain_accounts.controller.v1.rs +++ b/packages/proto/src/gen/ibc.applications.interchain_accounts.controller.v1.rs @@ -1,6 +1,7 @@ // @generated /// Params defines the set of on-chain interchain accounts parameters. /// The following parameters may be used to disable the controller submodule. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -19,6 +20,7 @@ impl ::prost::Name for Params { } } /// QueryInterchainAccountRequest is the request type for the Query/InterchainAccount RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryInterchainAccountRequest { @@ -38,6 +40,7 @@ impl ::prost::Name for QueryInterchainAccountRequest { } } /// QueryInterchainAccountResponse the response type for the Query/InterchainAccount RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryInterchainAccountResponse { @@ -55,6 +58,7 @@ impl ::prost::Name for QueryInterchainAccountResponse { } } /// QueryParamsRequest is the request type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} @@ -69,6 +73,7 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse is the response type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -87,6 +92,7 @@ impl ::prost::Name for QueryParamsResponse { } } /// MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRegisterInterchainAccount { @@ -108,6 +114,7 @@ impl ::prost::Name for MsgRegisterInterchainAccount { } } /// MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRegisterInterchainAccountResponse { @@ -127,6 +134,7 @@ impl ::prost::Name for MsgRegisterInterchainAccountResponse { } } /// MsgSendTx defines the payload for Msg/SendTx +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSendTx { @@ -152,6 +160,7 @@ impl ::prost::Name for MsgSendTx { } } /// MsgSendTxResponse defines the response for MsgSendTx +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSendTxResponse { @@ -561,6 +570,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x04, 0x03, 0x02, 0x00, 0x03, 0x12, 0x03, 0x31, 0x14, 0x15, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("ibc.applications.interchain_accounts.controller.v1.serde.rs"); include!("ibc.applications.interchain_accounts.controller.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/ibc.applications.interchain_accounts.controller.v1.serde.rs b/packages/proto/src/gen/ibc.applications.interchain_accounts.controller.v1.serde.rs deleted file mode 100644 index bf12f11..0000000 --- a/packages/proto/src/gen/ibc.applications.interchain_accounts.controller.v1.serde.rs +++ /dev/null @@ -1,1016 +0,0 @@ -// @generated -impl serde::Serialize for MsgRegisterInterchainAccount { - #[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.connection_id.is_empty() { - len += 1; - } - if !self.version.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", - len, - )?; - if !self.owner.is_empty() { - struct_ser.serialize_field("owner", &self.owner)?; - } - if !self.connection_id.is_empty() { - struct_ser.serialize_field("connectionId", &self.connection_id)?; - } - if !self.version.is_empty() { - struct_ser.serialize_field("version", &self.version)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgRegisterInterchainAccount { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["owner", "connection_id", "connectionId", "version"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Owner, - ConnectionId, - Version, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), - "version" => Ok(GeneratedField::Version), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgRegisterInterchainAccount; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut owner__ = None; - let mut connection_id__ = None; - let mut version__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Owner => { - if owner__.is_some() { - return Err(serde::de::Error::duplicate_field("owner")); - } - owner__ = Some(map.next_value()?); - } - GeneratedField::ConnectionId => { - if connection_id__.is_some() { - return Err(serde::de::Error::duplicate_field("connectionId")); - } - connection_id__ = Some(map.next_value()?); - } - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); - } - version__ = Some(map.next_value()?); - } - } - } - Ok(MsgRegisterInterchainAccount { - owner: owner__.unwrap_or_default(), - connection_id: connection_id__.unwrap_or_default(), - version: version__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgRegisterInterchainAccountResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.channel_id.is_empty() { - len += 1; - } - if !self.port_id.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccountResponse", len)?; - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgRegisterInterchainAccountResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["channel_id", "channelId", "port_id", "portId"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ChannelId, - PortId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "portId" | "port_id" => Ok(GeneratedField::PortId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgRegisterInterchainAccountResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccountResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut channel_id__ = None; - let mut port_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - } - } - Ok(MsgRegisterInterchainAccountResponse { - channel_id: channel_id__.unwrap_or_default(), - port_id: port_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccountResponse", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgSendTx { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.owner.is_empty() { - len += 1; - } - if !self.connection_id.is_empty() { - len += 1; - } - if self.packet_data.is_some() { - len += 1; - } - if self.relative_timeout != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.interchain_accounts.controller.v1.MsgSendTx", - len, - )?; - if !self.owner.is_empty() { - struct_ser.serialize_field("owner", &self.owner)?; - } - if !self.connection_id.is_empty() { - struct_ser.serialize_field("connectionId", &self.connection_id)?; - } - if let Some(v) = self.packet_data.as_ref() { - struct_ser.serialize_field("packetData", v)?; - } - if self.relative_timeout != 0 { - struct_ser.serialize_field( - "relativeTimeout", - ToString::to_string(&self.relative_timeout).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSendTx { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "owner", - "connection_id", - "connectionId", - "packet_data", - "packetData", - "relative_timeout", - "relativeTimeout", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Owner, - ConnectionId, - PacketData, - RelativeTimeout, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), - "packetData" | "packet_data" => Ok(GeneratedField::PacketData), - "relativeTimeout" | "relative_timeout" => { - Ok(GeneratedField::RelativeTimeout) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSendTx; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str( - "struct ibc.applications.interchain_accounts.controller.v1.MsgSendTx", - ) - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut owner__ = None; - let mut connection_id__ = None; - let mut packet_data__ = None; - let mut relative_timeout__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Owner => { - if owner__.is_some() { - return Err(serde::de::Error::duplicate_field("owner")); - } - owner__ = Some(map.next_value()?); - } - GeneratedField::ConnectionId => { - if connection_id__.is_some() { - return Err(serde::de::Error::duplicate_field("connectionId")); - } - connection_id__ = Some(map.next_value()?); - } - GeneratedField::PacketData => { - if packet_data__.is_some() { - return Err(serde::de::Error::duplicate_field("packetData")); - } - packet_data__ = map.next_value()?; - } - GeneratedField::RelativeTimeout => { - if relative_timeout__.is_some() { - return Err(serde::de::Error::duplicate_field("relativeTimeout")); - } - relative_timeout__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(MsgSendTx { - owner: owner__.unwrap_or_default(), - connection_id: connection_id__.unwrap_or_default(), - packet_data: packet_data__, - relative_timeout: relative_timeout__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.interchain_accounts.controller.v1.MsgSendTx", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgSendTxResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.sequence != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.interchain_accounts.controller.v1.MsgSendTxResponse", - len, - )?; - if self.sequence != 0 { - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSendTxResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["sequence"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Sequence, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "sequence" => Ok(GeneratedField::Sequence), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSendTxResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str( - "struct ibc.applications.interchain_accounts.controller.v1.MsgSendTxResponse", - ) - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sequence__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(MsgSendTxResponse { - sequence: sequence__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.interchain_accounts.controller.v1.MsgSendTxResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for 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.controller_enabled { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.interchain_accounts.controller.v1.Params", - len, - )?; - if self.controller_enabled { - struct_ser.serialize_field("controllerEnabled", &self.controller_enabled)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Params { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["controller_enabled", "controllerEnabled"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ControllerEnabled, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "controllerEnabled" | "controller_enabled" => { - Ok(GeneratedField::ControllerEnabled) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Params; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct ibc.applications.interchain_accounts.controller.v1.Params") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut controller_enabled__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ControllerEnabled => { - if controller_enabled__.is_some() { - return Err(serde::de::Error::duplicate_field("controllerEnabled")); - } - controller_enabled__ = Some(map.next_value()?); - } - } - } - Ok(Params { - controller_enabled: controller_enabled__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.interchain_accounts.controller.v1.Params", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryInterchainAccountRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.owner.is_empty() { - len += 1; - } - if !self.connection_id.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest", - len, - )?; - if !self.owner.is_empty() { - struct_ser.serialize_field("owner", &self.owner)?; - } - if !self.connection_id.is_empty() { - struct_ser.serialize_field("connectionId", &self.connection_id)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryInterchainAccountRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["owner", "connection_id", "connectionId"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Owner, - ConnectionId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryInterchainAccountRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut owner__ = None; - let mut connection_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Owner => { - if owner__.is_some() { - return Err(serde::de::Error::duplicate_field("owner")); - } - owner__ = Some(map.next_value()?); - } - GeneratedField::ConnectionId => { - if connection_id__.is_some() { - return Err(serde::de::Error::duplicate_field("connectionId")); - } - connection_id__ = Some(map.next_value()?); - } - } - } - Ok(QueryInterchainAccountRequest { - owner: owner__.unwrap_or_default(), - connection_id: connection_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryInterchainAccountResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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( - "ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse", - len, - )?; - if !self.address.is_empty() { - struct_ser.serialize_field("address", &self.address)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryInterchainAccountResponse { - #[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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = QueryInterchainAccountResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse") - } - - 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(QueryInterchainAccountResponse { - address: address__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryParamsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct( - "ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest", - len, - )?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 ibc.applications.interchain_accounts.controller.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( - "ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -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( - "ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse", - len, - )?; - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["params"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 ibc.applications.interchain_accounts.controller.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( - "ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/ibc.applications.interchain_accounts.genesis.v1.rs b/packages/proto/src/gen/ibc.applications.interchain_accounts.genesis.v1.rs index 9130be7..4fe091b 100644 --- a/packages/proto/src/gen/ibc.applications.interchain_accounts.genesis.v1.rs +++ b/packages/proto/src/gen/ibc.applications.interchain_accounts.genesis.v1.rs @@ -1,5 +1,6 @@ // @generated /// GenesisState defines the interchain accounts genesis state +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -19,6 +20,7 @@ impl ::prost::Name for GenesisState { } } /// ControllerGenesisState defines the interchain accounts controller genesis state +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ControllerGenesisState { @@ -42,6 +44,7 @@ impl ::prost::Name for ControllerGenesisState { } } /// HostGenesisState defines the interchain accounts host genesis state +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HostGenesisState { @@ -66,6 +69,7 @@ impl ::prost::Name for HostGenesisState { } /// ActiveChannel contains a connection ID, port ID and associated active channel ID, as well as a boolean flag to /// indicate if the channel is middleware enabled +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ActiveChannel { @@ -89,6 +93,7 @@ impl ::prost::Name for ActiveChannel { } } /// RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegisteredInterchainAccount { @@ -383,5 +388,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x08, 0x12, 0x03, 0x33, 0x1d, 0x50, 0x0a, 0x0f, 0x0a, 0x08, 0x04, 0x04, 0x02, 0x02, 0x08, 0xee, 0xfb, 0x03, 0x12, 0x03, 0x33, 0x1e, 0x4f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("ibc.applications.interchain_accounts.genesis.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/ibc.applications.interchain_accounts.genesis.v1.serde.rs b/packages/proto/src/gen/ibc.applications.interchain_accounts.genesis.v1.serde.rs deleted file mode 100644 index 171951a..0000000 --- a/packages/proto/src/gen/ibc.applications.interchain_accounts.genesis.v1.serde.rs +++ /dev/null @@ -1,761 +0,0 @@ -// @generated -impl serde::Serialize for ActiveChannel { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.connection_id.is_empty() { - len += 1; - } - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if self.is_middleware_enabled { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.interchain_accounts.genesis.v1.ActiveChannel", - len, - )?; - if !self.connection_id.is_empty() { - struct_ser.serialize_field("connectionId", &self.connection_id)?; - } - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if self.is_middleware_enabled { - struct_ser.serialize_field("isMiddlewareEnabled", &self.is_middleware_enabled)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ActiveChannel { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "connection_id", - "connectionId", - "port_id", - "portId", - "channel_id", - "channelId", - "is_middleware_enabled", - "isMiddlewareEnabled", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ConnectionId, - PortId, - ChannelId, - IsMiddlewareEnabled, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "isMiddlewareEnabled" | "is_middleware_enabled" => { - Ok(GeneratedField::IsMiddlewareEnabled) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ActiveChannel; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str( - "struct ibc.applications.interchain_accounts.genesis.v1.ActiveChannel", - ) - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut connection_id__ = None; - let mut port_id__ = None; - let mut channel_id__ = None; - let mut is_middleware_enabled__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ConnectionId => { - if connection_id__.is_some() { - return Err(serde::de::Error::duplicate_field("connectionId")); - } - connection_id__ = Some(map.next_value()?); - } - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::IsMiddlewareEnabled => { - if is_middleware_enabled__.is_some() { - return Err(serde::de::Error::duplicate_field( - "isMiddlewareEnabled", - )); - } - is_middleware_enabled__ = Some(map.next_value()?); - } - } - } - Ok(ActiveChannel { - connection_id: connection_id__.unwrap_or_default(), - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - is_middleware_enabled: is_middleware_enabled__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.interchain_accounts.genesis.v1.ActiveChannel", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ControllerGenesisState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.active_channels.is_empty() { - len += 1; - } - if !self.interchain_accounts.is_empty() { - len += 1; - } - if !self.ports.is_empty() { - len += 1; - } - if self.params.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.interchain_accounts.genesis.v1.ControllerGenesisState", - len, - )?; - if !self.active_channels.is_empty() { - struct_ser.serialize_field("activeChannels", &self.active_channels)?; - } - if !self.interchain_accounts.is_empty() { - struct_ser.serialize_field("interchainAccounts", &self.interchain_accounts)?; - } - if !self.ports.is_empty() { - struct_ser.serialize_field("ports", &self.ports)?; - } - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ControllerGenesisState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "active_channels", - "activeChannels", - "interchain_accounts", - "interchainAccounts", - "ports", - "params", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ActiveChannels, - InterchainAccounts, - Ports, - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "activeChannels" | "active_channels" => { - Ok(GeneratedField::ActiveChannels) - } - "interchainAccounts" | "interchain_accounts" => { - Ok(GeneratedField::InterchainAccounts) - } - "ports" => Ok(GeneratedField::Ports), - "params" => Ok(GeneratedField::Params), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ControllerGenesisState; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str( - "struct ibc.applications.interchain_accounts.genesis.v1.ControllerGenesisState", - ) - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut active_channels__ = None; - let mut interchain_accounts__ = None; - let mut ports__ = None; - let mut params__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ActiveChannels => { - if active_channels__.is_some() { - return Err(serde::de::Error::duplicate_field("activeChannels")); - } - active_channels__ = Some(map.next_value()?); - } - GeneratedField::InterchainAccounts => { - if interchain_accounts__.is_some() { - return Err(serde::de::Error::duplicate_field( - "interchainAccounts", - )); - } - interchain_accounts__ = Some(map.next_value()?); - } - GeneratedField::Ports => { - if ports__.is_some() { - return Err(serde::de::Error::duplicate_field("ports")); - } - ports__ = Some(map.next_value()?); - } - GeneratedField::Params => { - if params__.is_some() { - return Err(serde::de::Error::duplicate_field("params")); - } - params__ = map.next_value()?; - } - } - } - Ok(ControllerGenesisState { - active_channels: active_channels__.unwrap_or_default(), - interchain_accounts: interchain_accounts__.unwrap_or_default(), - ports: ports__.unwrap_or_default(), - params: params__, - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.interchain_accounts.genesis.v1.ControllerGenesisState", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for GenesisState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.controller_genesis_state.is_some() { - len += 1; - } - if self.host_genesis_state.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.interchain_accounts.genesis.v1.GenesisState", - len, - )?; - if let Some(v) = self.controller_genesis_state.as_ref() { - struct_ser.serialize_field("controllerGenesisState", v)?; - } - if let Some(v) = self.host_genesis_state.as_ref() { - struct_ser.serialize_field("hostGenesisState", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GenesisState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "controller_genesis_state", - "controllerGenesisState", - "host_genesis_state", - "hostGenesisState", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ControllerGenesisState, - HostGenesisState, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "controllerGenesisState" | "controller_genesis_state" => { - Ok(GeneratedField::ControllerGenesisState) - } - "hostGenesisState" | "host_genesis_state" => { - Ok(GeneratedField::HostGenesisState) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GenesisState; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str( - "struct ibc.applications.interchain_accounts.genesis.v1.GenesisState", - ) - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut controller_genesis_state__ = None; - let mut host_genesis_state__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ControllerGenesisState => { - if controller_genesis_state__.is_some() { - return Err(serde::de::Error::duplicate_field( - "controllerGenesisState", - )); - } - controller_genesis_state__ = map.next_value()?; - } - GeneratedField::HostGenesisState => { - if host_genesis_state__.is_some() { - return Err(serde::de::Error::duplicate_field("hostGenesisState")); - } - host_genesis_state__ = map.next_value()?; - } - } - } - Ok(GenesisState { - controller_genesis_state: controller_genesis_state__, - host_genesis_state: host_genesis_state__, - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.interchain_accounts.genesis.v1.GenesisState", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for HostGenesisState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.active_channels.is_empty() { - len += 1; - } - if !self.interchain_accounts.is_empty() { - len += 1; - } - if !self.port.is_empty() { - len += 1; - } - if self.params.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.interchain_accounts.genesis.v1.HostGenesisState", - len, - )?; - if !self.active_channels.is_empty() { - struct_ser.serialize_field("activeChannels", &self.active_channels)?; - } - if !self.interchain_accounts.is_empty() { - struct_ser.serialize_field("interchainAccounts", &self.interchain_accounts)?; - } - if !self.port.is_empty() { - struct_ser.serialize_field("port", &self.port)?; - } - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for HostGenesisState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "active_channels", - "activeChannels", - "interchain_accounts", - "interchainAccounts", - "port", - "params", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ActiveChannels, - InterchainAccounts, - Port, - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "activeChannels" | "active_channels" => { - Ok(GeneratedField::ActiveChannels) - } - "interchainAccounts" | "interchain_accounts" => { - Ok(GeneratedField::InterchainAccounts) - } - "port" => Ok(GeneratedField::Port), - "params" => Ok(GeneratedField::Params), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = HostGenesisState; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str( - "struct ibc.applications.interchain_accounts.genesis.v1.HostGenesisState", - ) - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut active_channels__ = None; - let mut interchain_accounts__ = None; - let mut port__ = None; - let mut params__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ActiveChannels => { - if active_channels__.is_some() { - return Err(serde::de::Error::duplicate_field("activeChannels")); - } - active_channels__ = Some(map.next_value()?); - } - GeneratedField::InterchainAccounts => { - if interchain_accounts__.is_some() { - return Err(serde::de::Error::duplicate_field( - "interchainAccounts", - )); - } - interchain_accounts__ = Some(map.next_value()?); - } - GeneratedField::Port => { - if port__.is_some() { - return Err(serde::de::Error::duplicate_field("port")); - } - port__ = Some(map.next_value()?); - } - GeneratedField::Params => { - if params__.is_some() { - return Err(serde::de::Error::duplicate_field("params")); - } - params__ = map.next_value()?; - } - } - } - Ok(HostGenesisState { - active_channels: active_channels__.unwrap_or_default(), - interchain_accounts: interchain_accounts__.unwrap_or_default(), - port: port__.unwrap_or_default(), - params: params__, - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.interchain_accounts.genesis.v1.HostGenesisState", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for RegisteredInterchainAccount { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.connection_id.is_empty() { - len += 1; - } - if !self.port_id.is_empty() { - len += 1; - } - if !self.account_address.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.interchain_accounts.genesis.v1.RegisteredInterchainAccount", - len, - )?; - if !self.connection_id.is_empty() { - struct_ser.serialize_field("connectionId", &self.connection_id)?; - } - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.account_address.is_empty() { - struct_ser.serialize_field("accountAddress", &self.account_address)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for RegisteredInterchainAccount { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "connection_id", - "connectionId", - "port_id", - "portId", - "account_address", - "accountAddress", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ConnectionId, - PortId, - AccountAddress, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), - "portId" | "port_id" => Ok(GeneratedField::PortId), - "accountAddress" | "account_address" => { - Ok(GeneratedField::AccountAddress) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = RegisteredInterchainAccount; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.interchain_accounts.genesis.v1.RegisteredInterchainAccount") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut connection_id__ = None; - let mut port_id__ = None; - let mut account_address__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ConnectionId => { - if connection_id__.is_some() { - return Err(serde::de::Error::duplicate_field("connectionId")); - } - connection_id__ = Some(map.next_value()?); - } - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::AccountAddress => { - if account_address__.is_some() { - return Err(serde::de::Error::duplicate_field("accountAddress")); - } - account_address__ = Some(map.next_value()?); - } - } - } - Ok(RegisteredInterchainAccount { - connection_id: connection_id__.unwrap_or_default(), - port_id: port_id__.unwrap_or_default(), - account_address: account_address__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.interchain_accounts.genesis.v1.RegisteredInterchainAccount", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/ibc.applications.interchain_accounts.host.v1.rs b/packages/proto/src/gen/ibc.applications.interchain_accounts.host.v1.rs index 4d696f0..d406107 100644 --- a/packages/proto/src/gen/ibc.applications.interchain_accounts.host.v1.rs +++ b/packages/proto/src/gen/ibc.applications.interchain_accounts.host.v1.rs @@ -1,6 +1,7 @@ // @generated /// Params defines the set of on-chain interchain accounts parameters. /// The following parameters may be used to disable the host submodule. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -22,6 +23,7 @@ impl ::prost::Name for Params { } } /// QueryParamsRequest is the request type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} @@ -36,6 +38,7 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse is the response type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -192,6 +195,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x04, 0x01, 0x02, 0x00, 0x03, 0x12, 0x03, 0x17, 0x12, 0x13, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("ibc.applications.interchain_accounts.host.v1.serde.rs"); include!("ibc.applications.interchain_accounts.host.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/ibc.applications.interchain_accounts.host.v1.serde.rs b/packages/proto/src/gen/ibc.applications.interchain_accounts.host.v1.serde.rs deleted file mode 100644 index beca106..0000000 --- a/packages/proto/src/gen/ibc.applications.interchain_accounts.host.v1.serde.rs +++ /dev/null @@ -1,298 +0,0 @@ -// @generated -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.host_enabled { - len += 1; - } - if !self.allow_messages.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.applications.interchain_accounts.host.v1.Params", len)?; - if self.host_enabled { - struct_ser.serialize_field("hostEnabled", &self.host_enabled)?; - } - if !self.allow_messages.is_empty() { - struct_ser.serialize_field("allowMessages", &self.allow_messages)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Params { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "host_enabled", - "hostEnabled", - "allow_messages", - "allowMessages", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - HostEnabled, - AllowMessages, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "hostEnabled" | "host_enabled" => Ok(GeneratedField::HostEnabled), - "allowMessages" | "allow_messages" => Ok(GeneratedField::AllowMessages), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Params; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.interchain_accounts.host.v1.Params") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut host_enabled__ = None; - let mut allow_messages__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::HostEnabled => { - if host_enabled__.is_some() { - return Err(serde::de::Error::duplicate_field("hostEnabled")); - } - host_enabled__ = Some(map.next_value()?); - } - GeneratedField::AllowMessages => { - if allow_messages__.is_some() { - return Err(serde::de::Error::duplicate_field("allowMessages")); - } - allow_messages__ = Some(map.next_value()?); - } - } - } - Ok(Params { - host_enabled: host_enabled__.unwrap_or_default(), - allow_messages: allow_messages__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.interchain_accounts.host.v1.Params", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryParamsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct( - "ibc.applications.interchain_accounts.host.v1.QueryParamsRequest", - len, - )?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 ibc.applications.interchain_accounts.host.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( - "ibc.applications.interchain_accounts.host.v1.QueryParamsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -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( - "ibc.applications.interchain_accounts.host.v1.QueryParamsResponse", - len, - )?; - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["params"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 ibc.applications.interchain_accounts.host.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( - "ibc.applications.interchain_accounts.host.v1.QueryParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/ibc.applications.interchain_accounts.v1.rs b/packages/proto/src/gen/ibc.applications.interchain_accounts.v1.rs index 158c02f..230e765 100644 --- a/packages/proto/src/gen/ibc.applications.interchain_accounts.v1.rs +++ b/packages/proto/src/gen/ibc.applications.interchain_accounts.v1.rs @@ -1,5 +1,6 @@ // @generated /// InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InterchainAccountPacketData { @@ -18,6 +19,7 @@ impl ::prost::Name for InterchainAccountPacketData { } } /// CosmosTx contains a list of sdk.Msg's. It should be used when sending transactions to an SDK host chain. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CosmosTx { @@ -33,7 +35,19 @@ impl ::prost::Name for CosmosTx { } /// Type defines a classification of message issued from a controller chain to its associated interchain accounts /// host -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum Type { /// Default zero value enumeration @@ -62,6 +76,7 @@ impl Type { } } /// An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InterchainAccount { @@ -80,6 +95,7 @@ impl ::prost::Name for InterchainAccount { } /// Metadata defines a set of protocol specific data encoded into the ICS27 channel version bytestring /// See ICS004: +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Metadata { @@ -380,5 +396,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x05, 0x04, 0x00, 0x02, 0x05, 0x03, 0x12, 0x03, 0x17, 0x13, 0x14, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("ibc.applications.interchain_accounts.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/ibc.applications.interchain_accounts.v1.serde.rs b/packages/proto/src/gen/ibc.applications.interchain_accounts.v1.serde.rs deleted file mode 100644 index 169875e..0000000 --- a/packages/proto/src/gen/ibc.applications.interchain_accounts.v1.serde.rs +++ /dev/null @@ -1,625 +0,0 @@ -// @generated -impl serde::Serialize for CosmosTx { - #[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; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.interchain_accounts.v1.CosmosTx", len)?; - if !self.messages.is_empty() { - struct_ser.serialize_field("messages", &self.messages)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CosmosTx { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["messages"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Messages, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CosmosTx; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.interchain_accounts.v1.CosmosTx") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut messages__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Messages => { - if messages__.is_some() { - return Err(serde::de::Error::duplicate_field("messages")); - } - messages__ = Some(map.next_value()?); - } - } - } - Ok(CosmosTx { - messages: messages__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.interchain_accounts.v1.CosmosTx", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for InterchainAccount { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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.account_owner.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.interchain_accounts.v1.InterchainAccount", - len, - )?; - if let Some(v) = self.base_account.as_ref() { - struct_ser.serialize_field("baseAccount", v)?; - } - if !self.account_owner.is_empty() { - struct_ser.serialize_field("accountOwner", &self.account_owner)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for InterchainAccount { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "base_account", - "baseAccount", - "account_owner", - "accountOwner", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - BaseAccount, - AccountOwner, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "accountOwner" | "account_owner" => Ok(GeneratedField::AccountOwner), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = InterchainAccount; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct ibc.applications.interchain_accounts.v1.InterchainAccount") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut base_account__ = None; - let mut account_owner__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::BaseAccount => { - if base_account__.is_some() { - return Err(serde::de::Error::duplicate_field("baseAccount")); - } - base_account__ = map.next_value()?; - } - GeneratedField::AccountOwner => { - if account_owner__.is_some() { - return Err(serde::de::Error::duplicate_field("accountOwner")); - } - account_owner__ = Some(map.next_value()?); - } - } - } - Ok(InterchainAccount { - base_account: base_account__, - account_owner: account_owner__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.interchain_accounts.v1.InterchainAccount", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for InterchainAccountPacketData { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.r#type != 0 { - len += 1; - } - if !self.data.is_empty() { - len += 1; - } - if !self.memo.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.interchain_accounts.v1.InterchainAccountPacketData", - len, - )?; - if self.r#type != 0 { - let v = Type::from_i32(self.r#type).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.r#type)) - })?; - struct_ser.serialize_field("type", &v)?; - } - if !self.data.is_empty() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - if !self.memo.is_empty() { - struct_ser.serialize_field("memo", &self.memo)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for InterchainAccountPacketData { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["type", "data", "memo"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Type, - Data, - Memo, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "data" => Ok(GeneratedField::Data), - "memo" => Ok(GeneratedField::Memo), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = InterchainAccountPacketData; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str( - "struct ibc.applications.interchain_accounts.v1.InterchainAccountPacketData", - ) - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut r#type__ = None; - let mut data__ = None; - let mut memo__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Type => { - if r#type__.is_some() { - return Err(serde::de::Error::duplicate_field("type")); - } - r#type__ = Some(map.next_value::()? as i32); - } - GeneratedField::Data => { - if data__.is_some() { - return Err(serde::de::Error::duplicate_field("data")); - } - data__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Memo => { - if memo__.is_some() { - return Err(serde::de::Error::duplicate_field("memo")); - } - memo__ = Some(map.next_value()?); - } - } - } - Ok(InterchainAccountPacketData { - r#type: r#type__.unwrap_or_default(), - data: data__.unwrap_or_default(), - memo: memo__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.interchain_accounts.v1.InterchainAccountPacketData", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for Metadata { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.version.is_empty() { - len += 1; - } - if !self.controller_connection_id.is_empty() { - len += 1; - } - if !self.host_connection_id.is_empty() { - len += 1; - } - if !self.address.is_empty() { - len += 1; - } - if !self.encoding.is_empty() { - len += 1; - } - if !self.tx_type.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.interchain_accounts.v1.Metadata", len)?; - if !self.version.is_empty() { - struct_ser.serialize_field("version", &self.version)?; - } - if !self.controller_connection_id.is_empty() { - struct_ser.serialize_field("controllerConnectionId", &self.controller_connection_id)?; - } - if !self.host_connection_id.is_empty() { - struct_ser.serialize_field("hostConnectionId", &self.host_connection_id)?; - } - if !self.address.is_empty() { - struct_ser.serialize_field("address", &self.address)?; - } - if !self.encoding.is_empty() { - struct_ser.serialize_field("encoding", &self.encoding)?; - } - if !self.tx_type.is_empty() { - struct_ser.serialize_field("txType", &self.tx_type)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Metadata { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "version", - "controller_connection_id", - "controllerConnectionId", - "host_connection_id", - "hostConnectionId", - "address", - "encoding", - "tx_type", - "txType", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Version, - ControllerConnectionId, - HostConnectionId, - Address, - Encoding, - TxType, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "controllerConnectionId" | "controller_connection_id" => { - Ok(GeneratedField::ControllerConnectionId) - } - "hostConnectionId" | "host_connection_id" => { - Ok(GeneratedField::HostConnectionId) - } - "address" => Ok(GeneratedField::Address), - "encoding" => Ok(GeneratedField::Encoding), - "txType" | "tx_type" => Ok(GeneratedField::TxType), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Metadata; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.interchain_accounts.v1.Metadata") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut version__ = None; - let mut controller_connection_id__ = None; - let mut host_connection_id__ = None; - let mut address__ = None; - let mut encoding__ = None; - let mut tx_type__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); - } - version__ = Some(map.next_value()?); - } - GeneratedField::ControllerConnectionId => { - if controller_connection_id__.is_some() { - return Err(serde::de::Error::duplicate_field( - "controllerConnectionId", - )); - } - controller_connection_id__ = Some(map.next_value()?); - } - GeneratedField::HostConnectionId => { - if host_connection_id__.is_some() { - return Err(serde::de::Error::duplicate_field("hostConnectionId")); - } - host_connection_id__ = Some(map.next_value()?); - } - GeneratedField::Address => { - if address__.is_some() { - return Err(serde::de::Error::duplicate_field("address")); - } - address__ = Some(map.next_value()?); - } - GeneratedField::Encoding => { - if encoding__.is_some() { - return Err(serde::de::Error::duplicate_field("encoding")); - } - encoding__ = Some(map.next_value()?); - } - GeneratedField::TxType => { - if tx_type__.is_some() { - return Err(serde::de::Error::duplicate_field("txType")); - } - tx_type__ = Some(map.next_value()?); - } - } - } - Ok(Metadata { - version: version__.unwrap_or_default(), - controller_connection_id: controller_connection_id__.unwrap_or_default(), - host_connection_id: host_connection_id__.unwrap_or_default(), - address: address__.unwrap_or_default(), - encoding: encoding__.unwrap_or_default(), - tx_type: tx_type__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.interchain_accounts.v1.Metadata", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for Type { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Unspecified => "TYPE_UNSPECIFIED", - Self::ExecuteTx => "TYPE_EXECUTE_TX", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for Type { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["TYPE_UNSPECIFIED", "TYPE_EXECUTE_TX"]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Type; - - fn expecting(&self, formatter: &mut 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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(Type::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(Type::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "TYPE_UNSPECIFIED" => Ok(Type::Unspecified), - "TYPE_EXECUTE_TX" => Ok(Type::ExecuteTx), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/ibc.applications.transfer.v1.rs b/packages/proto/src/gen/ibc.applications.transfer.v1.rs index 74dff39..0c4cab2 100644 --- a/packages/proto/src/gen/ibc.applications.transfer.v1.rs +++ b/packages/proto/src/gen/ibc.applications.transfer.v1.rs @@ -1,5 +1,6 @@ // @generated /// Allocation defines the spend limit for a particular port and channel +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Allocation { @@ -26,6 +27,7 @@ impl ::prost::Name for Allocation { } /// TransferAuthorization allows the grantee to spend up to spend_limit coins from /// the granter's account for ibc transfer on a specific channel +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TransferAuthorization { @@ -42,6 +44,7 @@ impl ::prost::Name for TransferAuthorization { } /// DenomTrace contains the base denomination for ICS20 fungible tokens and the /// source tracing information path. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DenomTrace { @@ -64,6 +67,7 @@ impl ::prost::Name for DenomTrace { /// NOTE: To prevent a single token from being transferred, set the /// TransfersEnabled parameter to true and then set the bank module's SendEnabled /// parameter for the denomination to false. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -84,6 +88,7 @@ impl ::prost::Name for Params { } } /// GenesisState defines the ibc-transfer genesis state +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -108,6 +113,7 @@ impl ::prost::Name for GenesisState { } /// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC /// method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomTraceRequest { @@ -124,6 +130,7 @@ impl ::prost::Name for QueryDenomTraceRequest { } /// QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomTraceResponse { @@ -140,6 +147,7 @@ impl ::prost::Name for QueryDenomTraceResponse { } /// QueryConnectionsRequest is the request type for the Query/DenomTraces RPC /// method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomTracesRequest { @@ -158,6 +166,7 @@ impl ::prost::Name for QueryDenomTracesRequest { } /// QueryConnectionsResponse is the response type for the Query/DenomTraces RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomTracesResponse { @@ -178,6 +187,7 @@ impl ::prost::Name for QueryDenomTracesResponse { } } /// QueryParamsRequest is the request type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} @@ -189,6 +199,7 @@ impl ::prost::Name for QueryParamsRequest { } } /// QueryParamsResponse is the response type for the Query/Params RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { @@ -205,6 +216,7 @@ impl ::prost::Name for QueryParamsResponse { } /// QueryDenomHashRequest is the request type for the Query/DenomHash RPC /// method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomHashRequest { @@ -221,6 +233,7 @@ impl ::prost::Name for QueryDenomHashRequest { } /// QueryDenomHashResponse is the response type for the Query/DenomHash RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomHashResponse { @@ -236,6 +249,7 @@ impl ::prost::Name for QueryDenomHashResponse { } } /// QueryEscrowAddressRequest is the request type for the EscrowAddress RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEscrowAddressRequest { @@ -254,6 +268,7 @@ impl ::prost::Name for QueryEscrowAddressRequest { } } /// QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEscrowAddressResponse { @@ -269,6 +284,7 @@ impl ::prost::Name for QueryEscrowAddressResponse { } } /// QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalEscrowForDenomRequest { @@ -283,6 +299,7 @@ impl ::prost::Name for QueryTotalEscrowForDenomRequest { } } /// QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalEscrowForDenomResponse { @@ -299,6 +316,7 @@ impl ::prost::Name for QueryTotalEscrowForDenomResponse { /// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between /// ICS20 enabled chains. See ICS Spec here: /// +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgTransfer { @@ -337,6 +355,7 @@ impl ::prost::Name for MsgTransfer { } } /// MsgTransferResponse defines the Msg/Transfer response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgTransferResponse { @@ -1188,6 +1207,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x01, 0x12, 0x03, 0x2f, 0x09, 0x11, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x00, 0x03, 0x12, 0x03, 0x2f, 0x14, 0x15, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("ibc.applications.transfer.v1.serde.rs"); include!("ibc.applications.transfer.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/ibc.applications.transfer.v1.serde.rs b/packages/proto/src/gen/ibc.applications.transfer.v1.serde.rs deleted file mode 100644 index 3d24a5e..0000000 --- a/packages/proto/src/gen/ibc.applications.transfer.v1.serde.rs +++ /dev/null @@ -1,2185 +0,0 @@ -// @generated -impl serde::Serialize for Allocation { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.source_port.is_empty() { - len += 1; - } - if !self.source_channel.is_empty() { - len += 1; - } - if !self.spend_limit.is_empty() { - len += 1; - } - if !self.allow_list.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.transfer.v1.Allocation", len)?; - if !self.source_port.is_empty() { - struct_ser.serialize_field("sourcePort", &self.source_port)?; - } - if !self.source_channel.is_empty() { - struct_ser.serialize_field("sourceChannel", &self.source_channel)?; - } - if !self.spend_limit.is_empty() { - struct_ser.serialize_field("spendLimit", &self.spend_limit)?; - } - if !self.allow_list.is_empty() { - struct_ser.serialize_field("allowList", &self.allow_list)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Allocation { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "source_port", - "sourcePort", - "source_channel", - "sourceChannel", - "spend_limit", - "spendLimit", - "allow_list", - "allowList", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SourcePort, - SourceChannel, - SpendLimit, - AllowList, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "sourcePort" | "source_port" => Ok(GeneratedField::SourcePort), - "sourceChannel" | "source_channel" => Ok(GeneratedField::SourceChannel), - "spendLimit" | "spend_limit" => Ok(GeneratedField::SpendLimit), - "allowList" | "allow_list" => Ok(GeneratedField::AllowList), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Allocation; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.transfer.v1.Allocation") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut source_port__ = None; - let mut source_channel__ = None; - let mut spend_limit__ = None; - let mut allow_list__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::SourcePort => { - if source_port__.is_some() { - return Err(serde::de::Error::duplicate_field("sourcePort")); - } - source_port__ = Some(map.next_value()?); - } - GeneratedField::SourceChannel => { - if source_channel__.is_some() { - return Err(serde::de::Error::duplicate_field("sourceChannel")); - } - source_channel__ = Some(map.next_value()?); - } - GeneratedField::SpendLimit => { - if spend_limit__.is_some() { - return Err(serde::de::Error::duplicate_field("spendLimit")); - } - spend_limit__ = Some(map.next_value()?); - } - GeneratedField::AllowList => { - if allow_list__.is_some() { - return Err(serde::de::Error::duplicate_field("allowList")); - } - allow_list__ = Some(map.next_value()?); - } - } - } - Ok(Allocation { - source_port: source_port__.unwrap_or_default(), - source_channel: source_channel__.unwrap_or_default(), - spend_limit: spend_limit__.unwrap_or_default(), - allow_list: allow_list__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.transfer.v1.Allocation", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for DenomTrace { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.path.is_empty() { - len += 1; - } - if !self.base_denom.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.transfer.v1.DenomTrace", len)?; - if !self.path.is_empty() { - struct_ser.serialize_field("path", &self.path)?; - } - if !self.base_denom.is_empty() { - struct_ser.serialize_field("baseDenom", &self.base_denom)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for DenomTrace { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["path", "base_denom", "baseDenom"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Path, - BaseDenom, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "baseDenom" | "base_denom" => Ok(GeneratedField::BaseDenom), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DenomTrace; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.transfer.v1.DenomTrace") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut path__ = None; - let mut base_denom__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); - } - path__ = Some(map.next_value()?); - } - GeneratedField::BaseDenom => { - if base_denom__.is_some() { - return Err(serde::de::Error::duplicate_field("baseDenom")); - } - base_denom__ = Some(map.next_value()?); - } - } - } - Ok(DenomTrace { - path: path__.unwrap_or_default(), - base_denom: base_denom__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.transfer.v1.DenomTrace", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for GenesisState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.denom_traces.is_empty() { - len += 1; - } - if self.params.is_some() { - len += 1; - } - if !self.total_escrowed.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.transfer.v1.GenesisState", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.denom_traces.is_empty() { - struct_ser.serialize_field("denomTraces", &self.denom_traces)?; - } - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - if !self.total_escrowed.is_empty() { - struct_ser.serialize_field("totalEscrowed", &self.total_escrowed)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GenesisState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "port_id", - "portId", - "denom_traces", - "denomTraces", - "params", - "total_escrowed", - "totalEscrowed", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - DenomTraces, - Params, - TotalEscrowed, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "denomTraces" | "denom_traces" => Ok(GeneratedField::DenomTraces), - "params" => Ok(GeneratedField::Params), - "totalEscrowed" | "total_escrowed" => Ok(GeneratedField::TotalEscrowed), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GenesisState; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.transfer.v1.GenesisState") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut denom_traces__ = None; - let mut params__ = None; - let mut total_escrowed__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::DenomTraces => { - if denom_traces__.is_some() { - return Err(serde::de::Error::duplicate_field("denomTraces")); - } - denom_traces__ = Some(map.next_value()?); - } - GeneratedField::Params => { - if params__.is_some() { - return Err(serde::de::Error::duplicate_field("params")); - } - params__ = map.next_value()?; - } - GeneratedField::TotalEscrowed => { - if total_escrowed__.is_some() { - return Err(serde::de::Error::duplicate_field("totalEscrowed")); - } - total_escrowed__ = Some(map.next_value()?); - } - } - } - Ok(GenesisState { - port_id: port_id__.unwrap_or_default(), - denom_traces: denom_traces__.unwrap_or_default(), - params: params__, - total_escrowed: total_escrowed__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.transfer.v1.GenesisState", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgTransfer { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.source_port.is_empty() { - len += 1; - } - if !self.source_channel.is_empty() { - len += 1; - } - if self.token.is_some() { - len += 1; - } - if !self.sender.is_empty() { - len += 1; - } - if !self.receiver.is_empty() { - len += 1; - } - if self.timeout_height.is_some() { - len += 1; - } - if self.timeout_timestamp != 0 { - len += 1; - } - if !self.memo.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.transfer.v1.MsgTransfer", len)?; - if !self.source_port.is_empty() { - struct_ser.serialize_field("sourcePort", &self.source_port)?; - } - if !self.source_channel.is_empty() { - struct_ser.serialize_field("sourceChannel", &self.source_channel)?; - } - if let Some(v) = self.token.as_ref() { - struct_ser.serialize_field("token", v)?; - } - if !self.sender.is_empty() { - struct_ser.serialize_field("sender", &self.sender)?; - } - if !self.receiver.is_empty() { - struct_ser.serialize_field("receiver", &self.receiver)?; - } - if let Some(v) = self.timeout_height.as_ref() { - struct_ser.serialize_field("timeoutHeight", v)?; - } - if self.timeout_timestamp != 0 { - struct_ser.serialize_field( - "timeoutTimestamp", - ToString::to_string(&self.timeout_timestamp).as_str(), - )?; - } - if !self.memo.is_empty() { - struct_ser.serialize_field("memo", &self.memo)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgTransfer { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "source_port", - "sourcePort", - "source_channel", - "sourceChannel", - "token", - "sender", - "receiver", - "timeout_height", - "timeoutHeight", - "timeout_timestamp", - "timeoutTimestamp", - "memo", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SourcePort, - SourceChannel, - Token, - Sender, - Receiver, - TimeoutHeight, - TimeoutTimestamp, - Memo, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "sourcePort" | "source_port" => Ok(GeneratedField::SourcePort), - "sourceChannel" | "source_channel" => Ok(GeneratedField::SourceChannel), - "token" => Ok(GeneratedField::Token), - "sender" => Ok(GeneratedField::Sender), - "receiver" => Ok(GeneratedField::Receiver), - "timeoutHeight" | "timeout_height" => Ok(GeneratedField::TimeoutHeight), - "timeoutTimestamp" | "timeout_timestamp" => { - Ok(GeneratedField::TimeoutTimestamp) - } - "memo" => Ok(GeneratedField::Memo), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgTransfer; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.transfer.v1.MsgTransfer") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut source_port__ = None; - let mut source_channel__ = None; - let mut token__ = None; - let mut sender__ = None; - let mut receiver__ = None; - let mut timeout_height__ = None; - let mut timeout_timestamp__ = None; - let mut memo__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::SourcePort => { - if source_port__.is_some() { - return Err(serde::de::Error::duplicate_field("sourcePort")); - } - source_port__ = Some(map.next_value()?); - } - GeneratedField::SourceChannel => { - if source_channel__.is_some() { - return Err(serde::de::Error::duplicate_field("sourceChannel")); - } - source_channel__ = Some(map.next_value()?); - } - GeneratedField::Token => { - if token__.is_some() { - return Err(serde::de::Error::duplicate_field("token")); - } - token__ = map.next_value()?; - } - GeneratedField::Sender => { - if sender__.is_some() { - return Err(serde::de::Error::duplicate_field("sender")); - } - sender__ = Some(map.next_value()?); - } - GeneratedField::Receiver => { - if receiver__.is_some() { - return Err(serde::de::Error::duplicate_field("receiver")); - } - receiver__ = Some(map.next_value()?); - } - GeneratedField::TimeoutHeight => { - if timeout_height__.is_some() { - return Err(serde::de::Error::duplicate_field("timeoutHeight")); - } - timeout_height__ = map.next_value()?; - } - GeneratedField::TimeoutTimestamp => { - if timeout_timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timeoutTimestamp")); - } - timeout_timestamp__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Memo => { - if memo__.is_some() { - return Err(serde::de::Error::duplicate_field("memo")); - } - memo__ = Some(map.next_value()?); - } - } - } - Ok(MsgTransfer { - source_port: source_port__.unwrap_or_default(), - source_channel: source_channel__.unwrap_or_default(), - token: token__, - sender: sender__.unwrap_or_default(), - receiver: receiver__.unwrap_or_default(), - timeout_height: timeout_height__, - timeout_timestamp: timeout_timestamp__.unwrap_or_default(), - memo: memo__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.transfer.v1.MsgTransfer", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgTransferResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.sequence != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.transfer.v1.MsgTransferResponse", len)?; - if self.sequence != 0 { - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgTransferResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["sequence"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Sequence, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "sequence" => Ok(GeneratedField::Sequence), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgTransferResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.transfer.v1.MsgTransferResponse") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sequence__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(MsgTransferResponse { - sequence: sequence__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.transfer.v1.MsgTransferResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for 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 { - len += 1; - } - if self.receive_enabled { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.applications.transfer.v1.Params", len)?; - if self.send_enabled { - struct_ser.serialize_field("sendEnabled", &self.send_enabled)?; - } - if self.receive_enabled { - struct_ser.serialize_field("receiveEnabled", &self.receive_enabled)?; - } - struct_ser.end() - } -} -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", - "receive_enabled", - "receiveEnabled", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SendEnabled, - ReceiveEnabled, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "receiveEnabled" | "receive_enabled" => { - Ok(GeneratedField::ReceiveEnabled) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Params; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.transfer.v1.Params") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut send_enabled__ = None; - let mut receive_enabled__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::SendEnabled => { - if send_enabled__.is_some() { - return Err(serde::de::Error::duplicate_field("sendEnabled")); - } - send_enabled__ = Some(map.next_value()?); - } - GeneratedField::ReceiveEnabled => { - if receive_enabled__.is_some() { - return Err(serde::de::Error::duplicate_field("receiveEnabled")); - } - receive_enabled__ = Some(map.next_value()?); - } - } - } - Ok(Params { - send_enabled: send_enabled__.unwrap_or_default(), - receive_enabled: receive_enabled__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.transfer.v1.Params", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryDenomHashRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.trace.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.applications.transfer.v1.QueryDenomHashRequest", len)?; - if !self.trace.is_empty() { - struct_ser.serialize_field("trace", &self.trace)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDenomHashRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["trace"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Trace, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "trace" => Ok(GeneratedField::Trace), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDenomHashRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.transfer.v1.QueryDenomHashRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut trace__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Trace => { - if trace__.is_some() { - return Err(serde::de::Error::duplicate_field("trace")); - } - trace__ = Some(map.next_value()?); - } - } - } - Ok(QueryDenomHashRequest { - trace: trace__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.transfer.v1.QueryDenomHashRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryDenomHashResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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("ibc.applications.transfer.v1.QueryDenomHashResponse", len)?; - if !self.hash.is_empty() { - struct_ser.serialize_field("hash", &self.hash)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDenomHashResponse { - #[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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = QueryDenomHashResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.transfer.v1.QueryDenomHashResponse") - } - - 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(QueryDenomHashResponse { - hash: hash__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.transfer.v1.QueryDenomHashResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryDenomTraceRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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("ibc.applications.transfer.v1.QueryDenomTraceRequest", len)?; - if !self.hash.is_empty() { - struct_ser.serialize_field("hash", &self.hash)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDenomTraceRequest { - #[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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = QueryDenomTraceRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.transfer.v1.QueryDenomTraceRequest") - } - - 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(QueryDenomTraceRequest { - hash: hash__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.transfer.v1.QueryDenomTraceRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryDenomTraceResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.denom_trace.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.applications.transfer.v1.QueryDenomTraceResponse", len)?; - if let Some(v) = self.denom_trace.as_ref() { - struct_ser.serialize_field("denomTrace", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDenomTraceResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["denom_trace", "denomTrace"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DenomTrace, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "denomTrace" | "denom_trace" => Ok(GeneratedField::DenomTrace), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDenomTraceResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.transfer.v1.QueryDenomTraceResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut denom_trace__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::DenomTrace => { - if denom_trace__.is_some() { - return Err(serde::de::Error::duplicate_field("denomTrace")); - } - denom_trace__ = map.next_value()?; - } - } - } - Ok(QueryDenomTraceResponse { - denom_trace: denom_trace__, - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.transfer.v1.QueryDenomTraceResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryDenomTracesRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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("ibc.applications.transfer.v1.QueryDenomTracesRequest", len)?; - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDenomTracesRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["pagination"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = QueryDenomTracesRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.transfer.v1.QueryDenomTracesRequest") - } - - 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(QueryDenomTracesRequest { - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.transfer.v1.QueryDenomTracesRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryDenomTracesResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.denom_traces.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.applications.transfer.v1.QueryDenomTracesResponse", len)?; - if !self.denom_traces.is_empty() { - struct_ser.serialize_field("denomTraces", &self.denom_traces)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryDenomTracesResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["denom_traces", "denomTraces", "pagination"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - DenomTraces, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "denomTraces" | "denom_traces" => Ok(GeneratedField::DenomTraces), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryDenomTracesResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.transfer.v1.QueryDenomTracesResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut denom_traces__ = None; - let mut pagination__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::DenomTraces => { - if denom_traces__.is_some() { - return Err(serde::de::Error::duplicate_field("denomTraces")); - } - denom_traces__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - } - } - Ok(QueryDenomTracesResponse { - denom_traces: denom_traces__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.transfer.v1.QueryDenomTracesResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryEscrowAddressRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.transfer.v1.QueryEscrowAddressRequest", - len, - )?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryEscrowAddressRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryEscrowAddressRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.transfer.v1.QueryEscrowAddressRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - } - } - Ok(QueryEscrowAddressRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.transfer.v1.QueryEscrowAddressRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryEscrowAddressResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.escrow_address.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.applications.transfer.v1.QueryEscrowAddressResponse", - len, - )?; - if !self.escrow_address.is_empty() { - struct_ser.serialize_field("escrowAddress", &self.escrow_address)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryEscrowAddressResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["escrow_address", "escrowAddress"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - EscrowAddress, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "escrowAddress" | "escrow_address" => Ok(GeneratedField::EscrowAddress), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryEscrowAddressResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct ibc.applications.transfer.v1.QueryEscrowAddressResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut escrow_address__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::EscrowAddress => { - if escrow_address__.is_some() { - return Err(serde::de::Error::duplicate_field("escrowAddress")); - } - escrow_address__ = Some(map.next_value()?); - } - } - } - Ok(QueryEscrowAddressResponse { - escrow_address: escrow_address__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.transfer.v1.QueryEscrowAddressResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryParamsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = - serializer.serialize_struct("ibc.applications.transfer.v1.QueryParamsRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 ibc.applications.transfer.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( - "ibc.applications.transfer.v1.QueryParamsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -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("ibc.applications.transfer.v1.QueryParamsResponse", len)?; - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["params"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 ibc.applications.transfer.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( - "ibc.applications.transfer.v1.QueryParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryTotalEscrowForDenomRequest { - #[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( - "ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest", - len, - )?; - if !self.denom.is_empty() { - struct_ser.serialize_field("denom", &self.denom)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryTotalEscrowForDenomRequest { - #[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, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = QueryTotalEscrowForDenomRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str( - "struct ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest", - ) - } - - 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(QueryTotalEscrowForDenomRequest { - denom: denom__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryTotalEscrowForDenomResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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( - "ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse", - len, - )?; - if let Some(v) = self.amount.as_ref() { - struct_ser.serialize_field("amount", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryTotalEscrowForDenomResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["amount"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Amount, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = QueryTotalEscrowForDenomResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str( - "struct ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse", - ) - } - - 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(QueryTotalEscrowForDenomResponse { amount: amount__ }) - } - } - deserializer.deserialize_struct( - "ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for TransferAuthorization { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.allocations.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.applications.transfer.v1.TransferAuthorization", len)?; - if !self.allocations.is_empty() { - struct_ser.serialize_field("allocations", &self.allocations)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TransferAuthorization { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["allocations"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Allocations, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "allocations" => Ok(GeneratedField::Allocations), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TransferAuthorization; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.transfer.v1.TransferAuthorization") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut allocations__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Allocations => { - if allocations__.is_some() { - return Err(serde::de::Error::duplicate_field("allocations")); - } - allocations__ = Some(map.next_value()?); - } - } - } - Ok(TransferAuthorization { - allocations: allocations__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.transfer.v1.TransferAuthorization", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/ibc.applications.transfer.v2.rs b/packages/proto/src/gen/ibc.applications.transfer.v2.rs index e0962b9..0ac7347 100644 --- a/packages/proto/src/gen/ibc.applications.transfer.v2.rs +++ b/packages/proto/src/gen/ibc.applications.transfer.v2.rs @@ -2,6 +2,7 @@ /// FungibleTokenPacketData defines a struct for the packet payload /// See FungibleTokenPacketData spec: /// +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FungibleTokenPacketData { @@ -97,5 +98,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x0d, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x04, 0x03, 0x12, 0x03, 0x13, 0x10, 0x11, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("ibc.applications.transfer.v2.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/ibc.applications.transfer.v2.serde.rs b/packages/proto/src/gen/ibc.applications.transfer.v2.serde.rs deleted file mode 100644 index f77e753..0000000 --- a/packages/proto/src/gen/ibc.applications.transfer.v2.serde.rs +++ /dev/null @@ -1,165 +0,0 @@ -// @generated -impl serde::Serialize for FungibleTokenPacketData { - #[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; - } - if !self.sender.is_empty() { - len += 1; - } - if !self.receiver.is_empty() { - len += 1; - } - if !self.memo.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.applications.transfer.v2.FungibleTokenPacketData", 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)?; - } - if !self.sender.is_empty() { - struct_ser.serialize_field("sender", &self.sender)?; - } - if !self.receiver.is_empty() { - struct_ser.serialize_field("receiver", &self.receiver)?; - } - if !self.memo.is_empty() { - struct_ser.serialize_field("memo", &self.memo)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for FungibleTokenPacketData { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["denom", "amount", "sender", "receiver", "memo"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Denom, - Amount, - Sender, - Receiver, - Memo, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "sender" => Ok(GeneratedField::Sender), - "receiver" => Ok(GeneratedField::Receiver), - "memo" => Ok(GeneratedField::Memo), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = FungibleTokenPacketData; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.applications.transfer.v2.FungibleTokenPacketData") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut denom__ = None; - let mut amount__ = None; - let mut sender__ = None; - let mut receiver__ = None; - let mut memo__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Denom => { - if denom__.is_some() { - return Err(serde::de::Error::duplicate_field("denom")); - } - denom__ = Some(map.next_value()?); - } - GeneratedField::Amount => { - if amount__.is_some() { - return Err(serde::de::Error::duplicate_field("amount")); - } - amount__ = Some(map.next_value()?); - } - GeneratedField::Sender => { - if sender__.is_some() { - return Err(serde::de::Error::duplicate_field("sender")); - } - sender__ = Some(map.next_value()?); - } - GeneratedField::Receiver => { - if receiver__.is_some() { - return Err(serde::de::Error::duplicate_field("receiver")); - } - receiver__ = Some(map.next_value()?); - } - GeneratedField::Memo => { - if memo__.is_some() { - return Err(serde::de::Error::duplicate_field("memo")); - } - memo__ = Some(map.next_value()?); - } - } - } - Ok(FungibleTokenPacketData { - denom: denom__.unwrap_or_default(), - amount: amount__.unwrap_or_default(), - sender: sender__.unwrap_or_default(), - receiver: receiver__.unwrap_or_default(), - memo: memo__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.applications.transfer.v2.FungibleTokenPacketData", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/ibc.core.channel.v1.rs b/packages/proto/src/gen/ibc.core.channel.v1.rs index 2ca7be8..7df4151 100644 --- a/packages/proto/src/gen/ibc.core.channel.v1.rs +++ b/packages/proto/src/gen/ibc.core.channel.v1.rs @@ -2,6 +2,7 @@ /// 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. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Channel { @@ -31,6 +32,7 @@ impl ::prost::Name for Channel { } /// IdentifiedChannel defines a channel with additional port and channel /// identifier fields. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IdentifiedChannel { @@ -65,6 +67,7 @@ impl ::prost::Name for IdentifiedChannel { } } /// Counterparty defines a channel end counterparty +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Counterparty { @@ -83,6 +86,7 @@ impl ::prost::Name for Counterparty { } } /// Packet defines a type that carries data across different chains through IBC +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Packet { @@ -124,6 +128,7 @@ impl ::prost::Name for Packet { /// packet commitments, acknowledgements, and receipts. /// Caller is responsible for knowing the context necessary to interpret this /// state as a commitment, acknowledgement, or a receipt. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PacketState { @@ -150,6 +155,7 @@ impl ::prost::Name for PacketState { /// PacketId is an identifer for a unique Packet /// Source chains refer to packets by source port/channel /// Destination chains refer to packets by destination port/channel +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PacketId { @@ -177,6 +183,7 @@ impl ::prost::Name for PacketId { /// The first byte of any message with this format will be the non-ASCII values /// `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: /// +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Acknowledgement { @@ -187,6 +194,7 @@ pub struct Acknowledgement { /// Nested message and enum types in `Acknowledgement`. pub mod acknowledgement { /// response contains either a result or an error and must be non-empty + #[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Response { @@ -205,7 +213,19 @@ impl ::prost::Name for Acknowledgement { } /// State defines if a channel is in one of the following states: /// CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum State { /// Default State @@ -248,7 +268,19 @@ impl State { } } /// Order defines if a channel is ORDERED or UNORDERED -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum Order { /// zero-value for channel ordering @@ -282,6 +314,7 @@ impl Order { } } /// GenesisState defines the ibc channel submodule's genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -312,6 +345,7 @@ impl ::prost::Name for GenesisState { } /// PacketSequence defines the genesis type necessary to retrieve and store /// next send and receive sequences. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PacketSequence { @@ -330,6 +364,7 @@ impl ::prost::Name for PacketSequence { } } /// QueryChannelRequest is the request type for the Query/Channel RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelRequest { @@ -350,6 +385,7 @@ impl ::prost::Name for QueryChannelRequest { /// QueryChannelResponse is the response type for the Query/Channel RPC method. /// Besides the Channel end, it includes a proof and the height from which the /// proof was retrieved. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelResponse { @@ -371,6 +407,7 @@ impl ::prost::Name for QueryChannelResponse { } } /// QueryChannelsRequest is the request type for the Query/Channels RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelsRequest { @@ -388,6 +425,7 @@ impl ::prost::Name for QueryChannelsRequest { } } /// QueryChannelsResponse is the response type for the Query/Channels RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelsResponse { @@ -412,6 +450,7 @@ impl ::prost::Name for QueryChannelsResponse { } /// QueryConnectionChannelsRequest is the request type for the /// Query/QueryConnectionChannels RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionChannelsRequest { @@ -433,6 +472,7 @@ impl ::prost::Name for QueryConnectionChannelsRequest { } /// QueryConnectionChannelsResponse is the Response type for the /// Query/QueryConnectionChannels RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionChannelsResponse { @@ -457,6 +497,7 @@ impl ::prost::Name for QueryConnectionChannelsResponse { } /// QueryChannelClientStateRequest is the request type for the Query/ClientState /// RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelClientStateRequest { @@ -476,6 +517,7 @@ impl ::prost::Name for QueryChannelClientStateRequest { } /// QueryChannelClientStateResponse is the Response type for the /// Query/QueryChannelClientState RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelClientStateResponse { @@ -499,6 +541,7 @@ impl ::prost::Name for QueryChannelClientStateResponse { } /// QueryChannelConsensusStateRequest is the request type for the /// Query/ConsensusState RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelConsensusStateRequest { @@ -524,6 +567,7 @@ impl ::prost::Name for QueryChannelConsensusStateRequest { } /// QueryChannelClientStateResponse is the Response type for the /// Query/QueryChannelClientState RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryChannelConsensusStateResponse { @@ -549,6 +593,7 @@ impl ::prost::Name for QueryChannelConsensusStateResponse { } /// QueryPacketCommitmentRequest is the request type for the /// Query/PacketCommitment RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketCommitmentRequest { @@ -572,6 +617,7 @@ impl ::prost::Name for QueryPacketCommitmentRequest { /// QueryPacketCommitmentResponse defines the client query response for a packet /// which also includes a proof and the height from which the proof was /// retrieved +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketCommitmentResponse { @@ -594,6 +640,7 @@ impl ::prost::Name for QueryPacketCommitmentResponse { } /// QueryPacketCommitmentsRequest is the request type for the /// Query/QueryPacketCommitments RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketCommitmentsRequest { @@ -618,6 +665,7 @@ impl ::prost::Name for QueryPacketCommitmentsRequest { } /// QueryPacketCommitmentsResponse is the request type for the /// Query/QueryPacketCommitments RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketCommitmentsResponse { @@ -641,6 +689,7 @@ impl ::prost::Name for QueryPacketCommitmentsResponse { } /// QueryPacketReceiptRequest is the request type for the /// Query/PacketReceipt RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketReceiptRequest { @@ -664,6 +713,7 @@ impl ::prost::Name for QueryPacketReceiptRequest { /// QueryPacketReceiptResponse defines the client query response for a packet /// receipt which also includes a proof, and the height from which the proof was /// retrieved +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketReceiptResponse { @@ -686,6 +736,7 @@ impl ::prost::Name for QueryPacketReceiptResponse { } /// QueryPacketAcknowledgementRequest is the request type for the /// Query/PacketAcknowledgement RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketAcknowledgementRequest { @@ -709,6 +760,7 @@ impl ::prost::Name for QueryPacketAcknowledgementRequest { /// QueryPacketAcknowledgementResponse defines the client query response for a /// packet which also includes a proof and the height from which the /// proof was retrieved +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketAcknowledgementResponse { @@ -731,6 +783,7 @@ impl ::prost::Name for QueryPacketAcknowledgementResponse { } /// QueryPacketAcknowledgementsRequest is the request type for the /// Query/QueryPacketCommitments RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketAcknowledgementsRequest { @@ -758,6 +811,7 @@ impl ::prost::Name for QueryPacketAcknowledgementsRequest { } /// QueryPacketAcknowledgemetsResponse is the request type for the /// Query/QueryPacketAcknowledgements RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPacketAcknowledgementsResponse { @@ -781,6 +835,7 @@ impl ::prost::Name for QueryPacketAcknowledgementsResponse { } /// QueryUnreceivedPacketsRequest is the request type for the /// Query/UnreceivedPackets RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUnreceivedPacketsRequest { @@ -803,6 +858,7 @@ impl ::prost::Name for QueryUnreceivedPacketsRequest { } /// QueryUnreceivedPacketsResponse is the response type for the /// Query/UnreceivedPacketCommitments RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUnreceivedPacketsResponse { @@ -822,6 +878,7 @@ impl ::prost::Name for QueryUnreceivedPacketsResponse { } /// QueryUnreceivedAcks is the request type for the /// Query/UnreceivedAcks RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUnreceivedAcksRequest { @@ -844,6 +901,7 @@ impl ::prost::Name for QueryUnreceivedAcksRequest { } /// QueryUnreceivedAcksResponse is the response type for the /// Query/UnreceivedAcks RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUnreceivedAcksResponse { @@ -863,6 +921,7 @@ impl ::prost::Name for QueryUnreceivedAcksResponse { } /// QueryNextSequenceReceiveRequest is the request type for the /// Query/QueryNextSequenceReceiveRequest RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNextSequenceReceiveRequest { @@ -882,6 +941,7 @@ impl ::prost::Name for QueryNextSequenceReceiveRequest { } /// QuerySequenceResponse is the request type for the /// Query/QueryNextSequenceReceiveResponse RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNextSequenceReceiveResponse { @@ -904,6 +964,7 @@ impl ::prost::Name for QueryNextSequenceReceiveResponse { } /// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It /// is called by a relayer on Chain A. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenInit { @@ -922,6 +983,7 @@ impl ::prost::Name for MsgChannelOpenInit { } } /// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenInitResponse { @@ -940,6 +1002,7 @@ impl ::prost::Name for MsgChannelOpenInitResponse { /// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel /// on Chain B. The version field within the Channel field has been deprecated. Its /// value will be ignored by core IBC. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenTry { @@ -969,6 +1032,7 @@ impl ::prost::Name for MsgChannelOpenTry { } } /// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenTryResponse { @@ -986,6 +1050,7 @@ impl ::prost::Name for MsgChannelOpenTryResponse { } /// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge /// the change of channel state to TRYOPEN on Chain B. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenAck { @@ -1012,6 +1077,7 @@ impl ::prost::Name for MsgChannelOpenAck { } } /// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenAckResponse {} @@ -1024,6 +1090,7 @@ impl ::prost::Name for MsgChannelOpenAckResponse { } /// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to /// acknowledge the change of channel state to OPEN on Chain A. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenConfirm { @@ -1047,6 +1114,7 @@ impl ::prost::Name for MsgChannelOpenConfirm { } /// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response /// type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenConfirmResponse {} @@ -1059,6 +1127,7 @@ impl ::prost::Name for MsgChannelOpenConfirmResponse { } /// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A /// to close a channel with Chain B. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelCloseInit { @@ -1077,6 +1146,7 @@ impl ::prost::Name for MsgChannelCloseInit { } } /// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelCloseInitResponse {} @@ -1089,6 +1159,7 @@ impl ::prost::Name for MsgChannelCloseInitResponse { } /// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B /// to acknowledge the change of channel state to CLOSED on Chain A. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelCloseConfirm { @@ -1112,6 +1183,7 @@ impl ::prost::Name for MsgChannelCloseConfirm { } /// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response /// type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelCloseConfirmResponse {} @@ -1123,6 +1195,7 @@ impl ::prost::Name for MsgChannelCloseConfirmResponse { } } /// MsgRecvPacket receives incoming IBC packet +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRecvPacket { @@ -1143,6 +1216,7 @@ impl ::prost::Name for MsgRecvPacket { } } /// MsgRecvPacketResponse defines the Msg/RecvPacket response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRecvPacketResponse { @@ -1157,6 +1231,7 @@ impl ::prost::Name for MsgRecvPacketResponse { } } /// MsgTimeout receives timed-out packet +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgTimeout { @@ -1179,6 +1254,7 @@ impl ::prost::Name for MsgTimeout { } } /// MsgTimeoutResponse defines the Msg/Timeout response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgTimeoutResponse { @@ -1193,6 +1269,7 @@ impl ::prost::Name for MsgTimeoutResponse { } } /// MsgTimeoutOnClose timed-out packet upon counterparty channel closure. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgTimeoutOnClose { @@ -1217,6 +1294,7 @@ impl ::prost::Name for MsgTimeoutOnClose { } } /// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgTimeoutOnCloseResponse { @@ -1231,6 +1309,7 @@ impl ::prost::Name for MsgTimeoutOnCloseResponse { } } /// MsgAcknowledgement receives incoming IBC acknowledgement +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgAcknowledgement { @@ -1253,6 +1332,7 @@ impl ::prost::Name for MsgAcknowledgement { } } /// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgAcknowledgementResponse { @@ -1267,7 +1347,19 @@ impl ::prost::Name for MsgAcknowledgementResponse { } } /// ResponseResultType defines the possible outcomes of the execution of a message -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum ResponseResultType { /// Default zero value enumeration @@ -4271,6 +4363,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x02, 0x00, 0x03, 0x12, 0x04, 0xf4, 0x01, 0x1e, 0x1f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("ibc.core.channel.v1.serde.rs"); include!("ibc.core.channel.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/ibc.core.channel.v1.serde.rs b/packages/proto/src/gen/ibc.core.channel.v1.serde.rs deleted file mode 100644 index 9d263b1..0000000 --- a/packages/proto/src/gen/ibc.core.channel.v1.serde.rs +++ /dev/null @@ -1,8043 +0,0 @@ -// @generated -impl serde::Serialize for Acknowledgement { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.response.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.Acknowledgement", len)?; - if let Some(v) = self.response.as_ref() { - match v { - acknowledgement::Response::Result(v) => { - struct_ser - .serialize_field("result", pbjson::private::base64::encode(&v).as_str())?; - } - acknowledgement::Response::Error(v) => { - struct_ser.serialize_field("error", v)?; - } - } - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Acknowledgement { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["result", "error"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Result, - Error, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "error" => Ok(GeneratedField::Error), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Acknowledgement; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.Acknowledgement") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut response__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Result => { - if response__.is_some() { - return Err(serde::de::Error::duplicate_field("result")); - } - response__ = map.next_value::<::std::option::Option<::pbjson::private::BytesDeserialize<_>>>()?.map(|x| acknowledgement::Response::Result(x.0)); - } - GeneratedField::Error => { - if response__.is_some() { - return Err(serde::de::Error::duplicate_field("error")); - } - response__ = map - .next_value::<::std::option::Option<_>>()? - .map(acknowledgement::Response::Error); - } - } - } - Ok(Acknowledgement { - response: response__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.Acknowledgement", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for Channel { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.state != 0 { - len += 1; - } - if self.ordering != 0 { - len += 1; - } - if self.counterparty.is_some() { - len += 1; - } - if !self.connection_hops.is_empty() { - len += 1; - } - if !self.version.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.Channel", len)?; - if self.state != 0 { - let v = State::from_i32(self.state).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.state)) - })?; - struct_ser.serialize_field("state", &v)?; - } - if self.ordering != 0 { - let v = Order::from_i32(self.ordering).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.ordering)) - })?; - struct_ser.serialize_field("ordering", &v)?; - } - if let Some(v) = self.counterparty.as_ref() { - struct_ser.serialize_field("counterparty", v)?; - } - if !self.connection_hops.is_empty() { - struct_ser.serialize_field("connectionHops", &self.connection_hops)?; - } - if !self.version.is_empty() { - struct_ser.serialize_field("version", &self.version)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Channel { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "state", - "ordering", - "counterparty", - "connection_hops", - "connectionHops", - "version", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - State, - Ordering, - Counterparty, - ConnectionHops, - Version, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "state" => Ok(GeneratedField::State), - "ordering" => Ok(GeneratedField::Ordering), - "counterparty" => Ok(GeneratedField::Counterparty), - "connectionHops" | "connection_hops" => { - Ok(GeneratedField::ConnectionHops) - } - "version" => Ok(GeneratedField::Version), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Channel; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.Channel") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut state__ = None; - let mut ordering__ = None; - let mut counterparty__ = None; - let mut connection_hops__ = None; - let mut version__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::State => { - if state__.is_some() { - return Err(serde::de::Error::duplicate_field("state")); - } - state__ = Some(map.next_value::()? as i32); - } - GeneratedField::Ordering => { - if ordering__.is_some() { - return Err(serde::de::Error::duplicate_field("ordering")); - } - ordering__ = Some(map.next_value::()? as i32); - } - GeneratedField::Counterparty => { - if counterparty__.is_some() { - return Err(serde::de::Error::duplicate_field("counterparty")); - } - counterparty__ = map.next_value()?; - } - GeneratedField::ConnectionHops => { - if connection_hops__.is_some() { - return Err(serde::de::Error::duplicate_field("connectionHops")); - } - connection_hops__ = Some(map.next_value()?); - } - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); - } - version__ = Some(map.next_value()?); - } - } - } - Ok(Channel { - state: state__.unwrap_or_default(), - ordering: ordering__.unwrap_or_default(), - counterparty: counterparty__, - connection_hops: connection_hops__.unwrap_or_default(), - version: version__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("ibc.core.channel.v1.Channel", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Counterparty { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.Counterparty", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Counterparty { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Counterparty; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.Counterparty") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - } - } - Ok(Counterparty { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.Counterparty", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for GenesisState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.channels.is_empty() { - len += 1; - } - if !self.acknowledgements.is_empty() { - len += 1; - } - if !self.commitments.is_empty() { - len += 1; - } - if !self.receipts.is_empty() { - len += 1; - } - if !self.send_sequences.is_empty() { - len += 1; - } - if !self.recv_sequences.is_empty() { - len += 1; - } - if !self.ack_sequences.is_empty() { - len += 1; - } - if self.next_channel_sequence != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.GenesisState", len)?; - if !self.channels.is_empty() { - struct_ser.serialize_field("channels", &self.channels)?; - } - if !self.acknowledgements.is_empty() { - struct_ser.serialize_field("acknowledgements", &self.acknowledgements)?; - } - if !self.commitments.is_empty() { - struct_ser.serialize_field("commitments", &self.commitments)?; - } - if !self.receipts.is_empty() { - struct_ser.serialize_field("receipts", &self.receipts)?; - } - if !self.send_sequences.is_empty() { - struct_ser.serialize_field("sendSequences", &self.send_sequences)?; - } - if !self.recv_sequences.is_empty() { - struct_ser.serialize_field("recvSequences", &self.recv_sequences)?; - } - if !self.ack_sequences.is_empty() { - struct_ser.serialize_field("ackSequences", &self.ack_sequences)?; - } - if self.next_channel_sequence != 0 { - struct_ser.serialize_field( - "nextChannelSequence", - ToString::to_string(&self.next_channel_sequence).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GenesisState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "channels", - "acknowledgements", - "commitments", - "receipts", - "send_sequences", - "sendSequences", - "recv_sequences", - "recvSequences", - "ack_sequences", - "ackSequences", - "next_channel_sequence", - "nextChannelSequence", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Channels, - Acknowledgements, - Commitments, - Receipts, - SendSequences, - RecvSequences, - AckSequences, - NextChannelSequence, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "channels" => Ok(GeneratedField::Channels), - "acknowledgements" => Ok(GeneratedField::Acknowledgements), - "commitments" => Ok(GeneratedField::Commitments), - "receipts" => Ok(GeneratedField::Receipts), - "sendSequences" | "send_sequences" => Ok(GeneratedField::SendSequences), - "recvSequences" | "recv_sequences" => Ok(GeneratedField::RecvSequences), - "ackSequences" | "ack_sequences" => Ok(GeneratedField::AckSequences), - "nextChannelSequence" | "next_channel_sequence" => { - Ok(GeneratedField::NextChannelSequence) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GenesisState; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.GenesisState") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut channels__ = None; - let mut acknowledgements__ = None; - let mut commitments__ = None; - let mut receipts__ = None; - let mut send_sequences__ = None; - let mut recv_sequences__ = None; - let mut ack_sequences__ = None; - let mut next_channel_sequence__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Channels => { - if channels__.is_some() { - return Err(serde::de::Error::duplicate_field("channels")); - } - channels__ = Some(map.next_value()?); - } - GeneratedField::Acknowledgements => { - if acknowledgements__.is_some() { - return Err(serde::de::Error::duplicate_field("acknowledgements")); - } - acknowledgements__ = Some(map.next_value()?); - } - GeneratedField::Commitments => { - if commitments__.is_some() { - return Err(serde::de::Error::duplicate_field("commitments")); - } - commitments__ = Some(map.next_value()?); - } - GeneratedField::Receipts => { - if receipts__.is_some() { - return Err(serde::de::Error::duplicate_field("receipts")); - } - receipts__ = Some(map.next_value()?); - } - GeneratedField::SendSequences => { - if send_sequences__.is_some() { - return Err(serde::de::Error::duplicate_field("sendSequences")); - } - send_sequences__ = Some(map.next_value()?); - } - GeneratedField::RecvSequences => { - if recv_sequences__.is_some() { - return Err(serde::de::Error::duplicate_field("recvSequences")); - } - recv_sequences__ = Some(map.next_value()?); - } - GeneratedField::AckSequences => { - if ack_sequences__.is_some() { - return Err(serde::de::Error::duplicate_field("ackSequences")); - } - ack_sequences__ = Some(map.next_value()?); - } - GeneratedField::NextChannelSequence => { - if next_channel_sequence__.is_some() { - return Err(serde::de::Error::duplicate_field( - "nextChannelSequence", - )); - } - next_channel_sequence__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(GenesisState { - channels: channels__.unwrap_or_default(), - acknowledgements: acknowledgements__.unwrap_or_default(), - commitments: commitments__.unwrap_or_default(), - receipts: receipts__.unwrap_or_default(), - send_sequences: send_sequences__.unwrap_or_default(), - recv_sequences: recv_sequences__.unwrap_or_default(), - ack_sequences: ack_sequences__.unwrap_or_default(), - next_channel_sequence: next_channel_sequence__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.GenesisState", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for IdentifiedChannel { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.state != 0 { - len += 1; - } - if self.ordering != 0 { - len += 1; - } - if self.counterparty.is_some() { - len += 1; - } - if !self.connection_hops.is_empty() { - len += 1; - } - if !self.version.is_empty() { - len += 1; - } - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.IdentifiedChannel", len)?; - if self.state != 0 { - let v = State::from_i32(self.state).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.state)) - })?; - struct_ser.serialize_field("state", &v)?; - } - if self.ordering != 0 { - let v = Order::from_i32(self.ordering).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.ordering)) - })?; - struct_ser.serialize_field("ordering", &v)?; - } - if let Some(v) = self.counterparty.as_ref() { - struct_ser.serialize_field("counterparty", v)?; - } - if !self.connection_hops.is_empty() { - struct_ser.serialize_field("connectionHops", &self.connection_hops)?; - } - if !self.version.is_empty() { - struct_ser.serialize_field("version", &self.version)?; - } - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for IdentifiedChannel { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "state", - "ordering", - "counterparty", - "connection_hops", - "connectionHops", - "version", - "port_id", - "portId", - "channel_id", - "channelId", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - State, - Ordering, - Counterparty, - ConnectionHops, - Version, - PortId, - ChannelId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "state" => Ok(GeneratedField::State), - "ordering" => Ok(GeneratedField::Ordering), - "counterparty" => Ok(GeneratedField::Counterparty), - "connectionHops" | "connection_hops" => { - Ok(GeneratedField::ConnectionHops) - } - "version" => Ok(GeneratedField::Version), - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IdentifiedChannel; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.IdentifiedChannel") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut state__ = None; - let mut ordering__ = None; - let mut counterparty__ = None; - let mut connection_hops__ = None; - let mut version__ = None; - let mut port_id__ = None; - let mut channel_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::State => { - if state__.is_some() { - return Err(serde::de::Error::duplicate_field("state")); - } - state__ = Some(map.next_value::()? as i32); - } - GeneratedField::Ordering => { - if ordering__.is_some() { - return Err(serde::de::Error::duplicate_field("ordering")); - } - ordering__ = Some(map.next_value::()? as i32); - } - GeneratedField::Counterparty => { - if counterparty__.is_some() { - return Err(serde::de::Error::duplicate_field("counterparty")); - } - counterparty__ = map.next_value()?; - } - GeneratedField::ConnectionHops => { - if connection_hops__.is_some() { - return Err(serde::de::Error::duplicate_field("connectionHops")); - } - connection_hops__ = Some(map.next_value()?); - } - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); - } - version__ = Some(map.next_value()?); - } - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - } - } - Ok(IdentifiedChannel { - state: state__.unwrap_or_default(), - ordering: ordering__.unwrap_or_default(), - counterparty: counterparty__, - connection_hops: connection_hops__.unwrap_or_default(), - version: version__.unwrap_or_default(), - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.IdentifiedChannel", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgAcknowledgement { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.packet.is_some() { - len += 1; - } - if !self.acknowledgement.is_empty() { - len += 1; - } - if !self.proof_acked.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - if !self.signer.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.MsgAcknowledgement", len)?; - if let Some(v) = self.packet.as_ref() { - struct_ser.serialize_field("packet", v)?; - } - if !self.acknowledgement.is_empty() { - struct_ser.serialize_field( - "acknowledgement", - pbjson::private::base64::encode(&self.acknowledgement).as_str(), - )?; - } - if !self.proof_acked.is_empty() { - struct_ser.serialize_field( - "proofAcked", - pbjson::private::base64::encode(&self.proof_acked).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - if !self.signer.is_empty() { - struct_ser.serialize_field("signer", &self.signer)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgAcknowledgement { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "packet", - "acknowledgement", - "proof_acked", - "proofAcked", - "proof_height", - "proofHeight", - "signer", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Packet, - Acknowledgement, - ProofAcked, - ProofHeight, - Signer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "packet" => Ok(GeneratedField::Packet), - "acknowledgement" => Ok(GeneratedField::Acknowledgement), - "proofAcked" | "proof_acked" => Ok(GeneratedField::ProofAcked), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - "signer" => Ok(GeneratedField::Signer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgAcknowledgement; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgAcknowledgement") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut packet__ = None; - let mut acknowledgement__ = None; - let mut proof_acked__ = None; - let mut proof_height__ = None; - let mut signer__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Packet => { - if packet__.is_some() { - return Err(serde::de::Error::duplicate_field("packet")); - } - packet__ = map.next_value()?; - } - GeneratedField::Acknowledgement => { - if acknowledgement__.is_some() { - return Err(serde::de::Error::duplicate_field("acknowledgement")); - } - acknowledgement__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofAcked => { - if proof_acked__.is_some() { - return Err(serde::de::Error::duplicate_field("proofAcked")); - } - proof_acked__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - GeneratedField::Signer => { - if signer__.is_some() { - return Err(serde::de::Error::duplicate_field("signer")); - } - signer__ = Some(map.next_value()?); - } - } - } - Ok(MsgAcknowledgement { - packet: packet__, - acknowledgement: acknowledgement__.unwrap_or_default(), - proof_acked: proof_acked__.unwrap_or_default(), - proof_height: proof_height__, - signer: signer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgAcknowledgement", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgAcknowledgementResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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("ibc.core.channel.v1.MsgAcknowledgementResponse", len)?; - if self.result != 0 { - let v = ResponseResultType::from_i32(self.result).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.result)) - })?; - struct_ser.serialize_field("result", &v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgAcknowledgementResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["result"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Result, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = MsgAcknowledgementResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgAcknowledgementResponse") - } - - 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(MsgAcknowledgementResponse { - result: result__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgAcknowledgementResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgChannelCloseConfirm { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if !self.proof_init.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - if !self.signer.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.MsgChannelCloseConfirm", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if !self.proof_init.is_empty() { - struct_ser.serialize_field( - "proofInit", - pbjson::private::base64::encode(&self.proof_init).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - if !self.signer.is_empty() { - struct_ser.serialize_field("signer", &self.signer)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgChannelCloseConfirm { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "port_id", - "portId", - "channel_id", - "channelId", - "proof_init", - "proofInit", - "proof_height", - "proofHeight", - "signer", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - ProofInit, - ProofHeight, - Signer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "proofInit" | "proof_init" => Ok(GeneratedField::ProofInit), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - "signer" => Ok(GeneratedField::Signer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgChannelCloseConfirm; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgChannelCloseConfirm") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut proof_init__ = None; - let mut proof_height__ = None; - let mut signer__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::ProofInit => { - if proof_init__.is_some() { - return Err(serde::de::Error::duplicate_field("proofInit")); - } - proof_init__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - GeneratedField::Signer => { - if signer__.is_some() { - return Err(serde::de::Error::duplicate_field("signer")); - } - signer__ = Some(map.next_value()?); - } - } - } - Ok(MsgChannelCloseConfirm { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - proof_init: proof_init__.unwrap_or_default(), - proof_height: proof_height__, - signer: signer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgChannelCloseConfirm", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgChannelCloseConfirmResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.MsgChannelCloseConfirmResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgChannelCloseConfirmResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgChannelCloseConfirmResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgChannelCloseConfirmResponse") - } - - 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(MsgChannelCloseConfirmResponse {}) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgChannelCloseConfirmResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgChannelCloseInit { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if !self.signer.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.MsgChannelCloseInit", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if !self.signer.is_empty() { - struct_ser.serialize_field("signer", &self.signer)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgChannelCloseInit { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId", "signer"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - Signer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "signer" => Ok(GeneratedField::Signer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgChannelCloseInit; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgChannelCloseInit") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut signer__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::Signer => { - if signer__.is_some() { - return Err(serde::de::Error::duplicate_field("signer")); - } - signer__ = Some(map.next_value()?); - } - } - } - Ok(MsgChannelCloseInit { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - signer: signer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgChannelCloseInit", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgChannelCloseInitResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.MsgChannelCloseInitResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgChannelCloseInitResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgChannelCloseInitResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgChannelCloseInitResponse") - } - - 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(MsgChannelCloseInitResponse {}) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgChannelCloseInitResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgChannelOpenAck { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if !self.counterparty_channel_id.is_empty() { - len += 1; - } - if !self.counterparty_version.is_empty() { - len += 1; - } - if !self.proof_try.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - if !self.signer.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.MsgChannelOpenAck", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if !self.counterparty_channel_id.is_empty() { - struct_ser.serialize_field("counterpartyChannelId", &self.counterparty_channel_id)?; - } - if !self.counterparty_version.is_empty() { - struct_ser.serialize_field("counterpartyVersion", &self.counterparty_version)?; - } - if !self.proof_try.is_empty() { - struct_ser.serialize_field( - "proofTry", - pbjson::private::base64::encode(&self.proof_try).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - if !self.signer.is_empty() { - struct_ser.serialize_field("signer", &self.signer)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgChannelOpenAck { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "port_id", - "portId", - "channel_id", - "channelId", - "counterparty_channel_id", - "counterpartyChannelId", - "counterparty_version", - "counterpartyVersion", - "proof_try", - "proofTry", - "proof_height", - "proofHeight", - "signer", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - CounterpartyChannelId, - CounterpartyVersion, - ProofTry, - ProofHeight, - Signer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "counterpartyChannelId" | "counterparty_channel_id" => { - Ok(GeneratedField::CounterpartyChannelId) - } - "counterpartyVersion" | "counterparty_version" => { - Ok(GeneratedField::CounterpartyVersion) - } - "proofTry" | "proof_try" => Ok(GeneratedField::ProofTry), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - "signer" => Ok(GeneratedField::Signer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgChannelOpenAck; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgChannelOpenAck") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut counterparty_channel_id__ = None; - let mut counterparty_version__ = None; - let mut proof_try__ = None; - let mut proof_height__ = None; - let mut signer__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::CounterpartyChannelId => { - if counterparty_channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field( - "counterpartyChannelId", - )); - } - counterparty_channel_id__ = Some(map.next_value()?); - } - GeneratedField::CounterpartyVersion => { - if counterparty_version__.is_some() { - return Err(serde::de::Error::duplicate_field( - "counterpartyVersion", - )); - } - counterparty_version__ = Some(map.next_value()?); - } - GeneratedField::ProofTry => { - if proof_try__.is_some() { - return Err(serde::de::Error::duplicate_field("proofTry")); - } - proof_try__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - GeneratedField::Signer => { - if signer__.is_some() { - return Err(serde::de::Error::duplicate_field("signer")); - } - signer__ = Some(map.next_value()?); - } - } - } - Ok(MsgChannelOpenAck { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - counterparty_channel_id: counterparty_channel_id__.unwrap_or_default(), - counterparty_version: counterparty_version__.unwrap_or_default(), - proof_try: proof_try__.unwrap_or_default(), - proof_height: proof_height__, - signer: signer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgChannelOpenAck", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgChannelOpenAckResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.MsgChannelOpenAckResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgChannelOpenAckResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgChannelOpenAckResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgChannelOpenAckResponse") - } - - 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(MsgChannelOpenAckResponse {}) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgChannelOpenAckResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgChannelOpenConfirm { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if !self.proof_ack.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - if !self.signer.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.MsgChannelOpenConfirm", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if !self.proof_ack.is_empty() { - struct_ser.serialize_field( - "proofAck", - pbjson::private::base64::encode(&self.proof_ack).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - if !self.signer.is_empty() { - struct_ser.serialize_field("signer", &self.signer)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgChannelOpenConfirm { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "port_id", - "portId", - "channel_id", - "channelId", - "proof_ack", - "proofAck", - "proof_height", - "proofHeight", - "signer", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - ProofAck, - ProofHeight, - Signer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "proofAck" | "proof_ack" => Ok(GeneratedField::ProofAck), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - "signer" => Ok(GeneratedField::Signer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgChannelOpenConfirm; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgChannelOpenConfirm") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut proof_ack__ = None; - let mut proof_height__ = None; - let mut signer__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::ProofAck => { - if proof_ack__.is_some() { - return Err(serde::de::Error::duplicate_field("proofAck")); - } - proof_ack__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - GeneratedField::Signer => { - if signer__.is_some() { - return Err(serde::de::Error::duplicate_field("signer")); - } - signer__ = Some(map.next_value()?); - } - } - } - Ok(MsgChannelOpenConfirm { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - proof_ack: proof_ack__.unwrap_or_default(), - proof_height: proof_height__, - signer: signer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgChannelOpenConfirm", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgChannelOpenConfirmResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.MsgChannelOpenConfirmResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgChannelOpenConfirmResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgChannelOpenConfirmResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgChannelOpenConfirmResponse") - } - - 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(MsgChannelOpenConfirmResponse {}) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgChannelOpenConfirmResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgChannelOpenInit { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if self.channel.is_some() { - len += 1; - } - if !self.signer.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.MsgChannelOpenInit", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if let Some(v) = self.channel.as_ref() { - struct_ser.serialize_field("channel", v)?; - } - if !self.signer.is_empty() { - struct_ser.serialize_field("signer", &self.signer)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgChannelOpenInit { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["port_id", "portId", "channel", "signer"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - Channel, - Signer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channel" => Ok(GeneratedField::Channel), - "signer" => Ok(GeneratedField::Signer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgChannelOpenInit; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgChannelOpenInit") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel__ = None; - let mut signer__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::Channel => { - if channel__.is_some() { - return Err(serde::de::Error::duplicate_field("channel")); - } - channel__ = map.next_value()?; - } - GeneratedField::Signer => { - if signer__.is_some() { - return Err(serde::de::Error::duplicate_field("signer")); - } - signer__ = Some(map.next_value()?); - } - } - } - Ok(MsgChannelOpenInit { - port_id: port_id__.unwrap_or_default(), - channel: channel__, - signer: signer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgChannelOpenInit", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgChannelOpenInitResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.channel_id.is_empty() { - len += 1; - } - if !self.version.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.MsgChannelOpenInitResponse", len)?; - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if !self.version.is_empty() { - struct_ser.serialize_field("version", &self.version)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgChannelOpenInitResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["channel_id", "channelId", "version"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ChannelId, - Version, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "version" => Ok(GeneratedField::Version), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgChannelOpenInitResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgChannelOpenInitResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut channel_id__ = None; - let mut version__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); - } - version__ = Some(map.next_value()?); - } - } - } - Ok(MsgChannelOpenInitResponse { - channel_id: channel_id__.unwrap_or_default(), - version: version__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgChannelOpenInitResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgChannelOpenTry { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.previous_channel_id.is_empty() { - len += 1; - } - if self.channel.is_some() { - len += 1; - } - if !self.counterparty_version.is_empty() { - len += 1; - } - if !self.proof_init.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - if !self.signer.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.MsgChannelOpenTry", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.previous_channel_id.is_empty() { - struct_ser.serialize_field("previousChannelId", &self.previous_channel_id)?; - } - if let Some(v) = self.channel.as_ref() { - struct_ser.serialize_field("channel", v)?; - } - if !self.counterparty_version.is_empty() { - struct_ser.serialize_field("counterpartyVersion", &self.counterparty_version)?; - } - if !self.proof_init.is_empty() { - struct_ser.serialize_field( - "proofInit", - pbjson::private::base64::encode(&self.proof_init).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - if !self.signer.is_empty() { - struct_ser.serialize_field("signer", &self.signer)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgChannelOpenTry { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "port_id", - "portId", - "previous_channel_id", - "previousChannelId", - "channel", - "counterparty_version", - "counterpartyVersion", - "proof_init", - "proofInit", - "proof_height", - "proofHeight", - "signer", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - PreviousChannelId, - Channel, - CounterpartyVersion, - ProofInit, - ProofHeight, - Signer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "previousChannelId" | "previous_channel_id" => { - Ok(GeneratedField::PreviousChannelId) - } - "channel" => Ok(GeneratedField::Channel), - "counterpartyVersion" | "counterparty_version" => { - Ok(GeneratedField::CounterpartyVersion) - } - "proofInit" | "proof_init" => Ok(GeneratedField::ProofInit), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - "signer" => Ok(GeneratedField::Signer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgChannelOpenTry; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgChannelOpenTry") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut previous_channel_id__ = None; - let mut channel__ = None; - let mut counterparty_version__ = None; - let mut proof_init__ = None; - let mut proof_height__ = None; - let mut signer__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::PreviousChannelId => { - if previous_channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("previousChannelId")); - } - previous_channel_id__ = Some(map.next_value()?); - } - GeneratedField::Channel => { - if channel__.is_some() { - return Err(serde::de::Error::duplicate_field("channel")); - } - channel__ = map.next_value()?; - } - GeneratedField::CounterpartyVersion => { - if counterparty_version__.is_some() { - return Err(serde::de::Error::duplicate_field( - "counterpartyVersion", - )); - } - counterparty_version__ = Some(map.next_value()?); - } - GeneratedField::ProofInit => { - if proof_init__.is_some() { - return Err(serde::de::Error::duplicate_field("proofInit")); - } - proof_init__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - GeneratedField::Signer => { - if signer__.is_some() { - return Err(serde::de::Error::duplicate_field("signer")); - } - signer__ = Some(map.next_value()?); - } - } - } - Ok(MsgChannelOpenTry { - port_id: port_id__.unwrap_or_default(), - previous_channel_id: previous_channel_id__.unwrap_or_default(), - channel: channel__, - counterparty_version: counterparty_version__.unwrap_or_default(), - proof_init: proof_init__.unwrap_or_default(), - proof_height: proof_height__, - signer: signer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgChannelOpenTry", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgChannelOpenTryResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.version.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.MsgChannelOpenTryResponse", len)?; - if !self.version.is_empty() { - struct_ser.serialize_field("version", &self.version)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgChannelOpenTryResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["version", "channel_id", "channelId"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Version, - ChannelId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgChannelOpenTryResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgChannelOpenTryResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut version__ = None; - let mut channel_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); - } - version__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - } - } - Ok(MsgChannelOpenTryResponse { - version: version__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgChannelOpenTryResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgRecvPacket { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.packet.is_some() { - len += 1; - } - if !self.proof_commitment.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - if !self.signer.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.MsgRecvPacket", len)?; - if let Some(v) = self.packet.as_ref() { - struct_ser.serialize_field("packet", v)?; - } - if !self.proof_commitment.is_empty() { - struct_ser.serialize_field( - "proofCommitment", - pbjson::private::base64::encode(&self.proof_commitment).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - if !self.signer.is_empty() { - struct_ser.serialize_field("signer", &self.signer)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgRecvPacket { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "packet", - "proof_commitment", - "proofCommitment", - "proof_height", - "proofHeight", - "signer", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Packet, - ProofCommitment, - ProofHeight, - Signer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "packet" => Ok(GeneratedField::Packet), - "proofCommitment" | "proof_commitment" => { - Ok(GeneratedField::ProofCommitment) - } - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - "signer" => Ok(GeneratedField::Signer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgRecvPacket; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgRecvPacket") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut packet__ = None; - let mut proof_commitment__ = None; - let mut proof_height__ = None; - let mut signer__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Packet => { - if packet__.is_some() { - return Err(serde::de::Error::duplicate_field("packet")); - } - packet__ = map.next_value()?; - } - GeneratedField::ProofCommitment => { - if proof_commitment__.is_some() { - return Err(serde::de::Error::duplicate_field("proofCommitment")); - } - proof_commitment__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - GeneratedField::Signer => { - if signer__.is_some() { - return Err(serde::de::Error::duplicate_field("signer")); - } - signer__ = Some(map.next_value()?); - } - } - } - Ok(MsgRecvPacket { - packet: packet__, - proof_commitment: proof_commitment__.unwrap_or_default(), - proof_height: proof_height__, - signer: signer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgRecvPacket", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgRecvPacketResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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("ibc.core.channel.v1.MsgRecvPacketResponse", len)?; - if self.result != 0 { - let v = ResponseResultType::from_i32(self.result).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.result)) - })?; - struct_ser.serialize_field("result", &v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgRecvPacketResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["result"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Result, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = MsgRecvPacketResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgRecvPacketResponse") - } - - 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(MsgRecvPacketResponse { - result: result__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgRecvPacketResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgTimeout { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.packet.is_some() { - len += 1; - } - if !self.proof_unreceived.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - if self.next_sequence_recv != 0 { - len += 1; - } - if !self.signer.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.MsgTimeout", len)?; - if let Some(v) = self.packet.as_ref() { - struct_ser.serialize_field("packet", v)?; - } - if !self.proof_unreceived.is_empty() { - struct_ser.serialize_field( - "proofUnreceived", - pbjson::private::base64::encode(&self.proof_unreceived).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - if self.next_sequence_recv != 0 { - struct_ser.serialize_field( - "nextSequenceRecv", - ToString::to_string(&self.next_sequence_recv).as_str(), - )?; - } - if !self.signer.is_empty() { - struct_ser.serialize_field("signer", &self.signer)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgTimeout { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "packet", - "proof_unreceived", - "proofUnreceived", - "proof_height", - "proofHeight", - "next_sequence_recv", - "nextSequenceRecv", - "signer", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Packet, - ProofUnreceived, - ProofHeight, - NextSequenceRecv, - Signer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "packet" => Ok(GeneratedField::Packet), - "proofUnreceived" | "proof_unreceived" => { - Ok(GeneratedField::ProofUnreceived) - } - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - "nextSequenceRecv" | "next_sequence_recv" => { - Ok(GeneratedField::NextSequenceRecv) - } - "signer" => Ok(GeneratedField::Signer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgTimeout; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgTimeout") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut packet__ = None; - let mut proof_unreceived__ = None; - let mut proof_height__ = None; - let mut next_sequence_recv__ = None; - let mut signer__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Packet => { - if packet__.is_some() { - return Err(serde::de::Error::duplicate_field("packet")); - } - packet__ = map.next_value()?; - } - GeneratedField::ProofUnreceived => { - if proof_unreceived__.is_some() { - return Err(serde::de::Error::duplicate_field("proofUnreceived")); - } - proof_unreceived__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - GeneratedField::NextSequenceRecv => { - if next_sequence_recv__.is_some() { - return Err(serde::de::Error::duplicate_field("nextSequenceRecv")); - } - next_sequence_recv__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Signer => { - if signer__.is_some() { - return Err(serde::de::Error::duplicate_field("signer")); - } - signer__ = Some(map.next_value()?); - } - } - } - Ok(MsgTimeout { - packet: packet__, - proof_unreceived: proof_unreceived__.unwrap_or_default(), - proof_height: proof_height__, - next_sequence_recv: next_sequence_recv__.unwrap_or_default(), - signer: signer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("ibc.core.channel.v1.MsgTimeout", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for MsgTimeoutOnClose { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.packet.is_some() { - len += 1; - } - if !self.proof_unreceived.is_empty() { - len += 1; - } - if !self.proof_close.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - if self.next_sequence_recv != 0 { - len += 1; - } - if !self.signer.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.MsgTimeoutOnClose", len)?; - if let Some(v) = self.packet.as_ref() { - struct_ser.serialize_field("packet", v)?; - } - if !self.proof_unreceived.is_empty() { - struct_ser.serialize_field( - "proofUnreceived", - pbjson::private::base64::encode(&self.proof_unreceived).as_str(), - )?; - } - if !self.proof_close.is_empty() { - struct_ser.serialize_field( - "proofClose", - pbjson::private::base64::encode(&self.proof_close).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - if self.next_sequence_recv != 0 { - struct_ser.serialize_field( - "nextSequenceRecv", - ToString::to_string(&self.next_sequence_recv).as_str(), - )?; - } - if !self.signer.is_empty() { - struct_ser.serialize_field("signer", &self.signer)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgTimeoutOnClose { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "packet", - "proof_unreceived", - "proofUnreceived", - "proof_close", - "proofClose", - "proof_height", - "proofHeight", - "next_sequence_recv", - "nextSequenceRecv", - "signer", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Packet, - ProofUnreceived, - ProofClose, - ProofHeight, - NextSequenceRecv, - Signer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "packet" => Ok(GeneratedField::Packet), - "proofUnreceived" | "proof_unreceived" => { - Ok(GeneratedField::ProofUnreceived) - } - "proofClose" | "proof_close" => Ok(GeneratedField::ProofClose), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - "nextSequenceRecv" | "next_sequence_recv" => { - Ok(GeneratedField::NextSequenceRecv) - } - "signer" => Ok(GeneratedField::Signer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgTimeoutOnClose; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgTimeoutOnClose") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut packet__ = None; - let mut proof_unreceived__ = None; - let mut proof_close__ = None; - let mut proof_height__ = None; - let mut next_sequence_recv__ = None; - let mut signer__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Packet => { - if packet__.is_some() { - return Err(serde::de::Error::duplicate_field("packet")); - } - packet__ = map.next_value()?; - } - GeneratedField::ProofUnreceived => { - if proof_unreceived__.is_some() { - return Err(serde::de::Error::duplicate_field("proofUnreceived")); - } - proof_unreceived__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofClose => { - if proof_close__.is_some() { - return Err(serde::de::Error::duplicate_field("proofClose")); - } - proof_close__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - GeneratedField::NextSequenceRecv => { - if next_sequence_recv__.is_some() { - return Err(serde::de::Error::duplicate_field("nextSequenceRecv")); - } - next_sequence_recv__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Signer => { - if signer__.is_some() { - return Err(serde::de::Error::duplicate_field("signer")); - } - signer__ = Some(map.next_value()?); - } - } - } - Ok(MsgTimeoutOnClose { - packet: packet__, - proof_unreceived: proof_unreceived__.unwrap_or_default(), - proof_close: proof_close__.unwrap_or_default(), - proof_height: proof_height__, - next_sequence_recv: next_sequence_recv__.unwrap_or_default(), - signer: signer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgTimeoutOnClose", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgTimeoutOnCloseResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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("ibc.core.channel.v1.MsgTimeoutOnCloseResponse", len)?; - if self.result != 0 { - let v = ResponseResultType::from_i32(self.result).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.result)) - })?; - struct_ser.serialize_field("result", &v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgTimeoutOnCloseResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["result"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Result, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = MsgTimeoutOnCloseResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgTimeoutOnCloseResponse") - } - - 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(MsgTimeoutOnCloseResponse { - result: result__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgTimeoutOnCloseResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgTimeoutResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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("ibc.core.channel.v1.MsgTimeoutResponse", len)?; - if self.result != 0 { - let v = ResponseResultType::from_i32(self.result).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.result)) - })?; - struct_ser.serialize_field("result", &v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgTimeoutResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["result"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Result, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = MsgTimeoutResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgTimeoutResponse") - } - - 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(MsgTimeoutResponse { - result: result__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgTimeoutResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for Order { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::NoneUnspecified => "ORDER_NONE_UNSPECIFIED", - Self::Unordered => "ORDER_UNORDERED", - Self::Ordered => "ORDER_ORDERED", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for Order { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["ORDER_NONE_UNSPECIFIED", "ORDER_UNORDERED", "ORDER_ORDERED"]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Order; - - fn expecting(&self, formatter: &mut 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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(Order::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(Order::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "ORDER_NONE_UNSPECIFIED" => Ok(Order::NoneUnspecified), - "ORDER_UNORDERED" => Ok(Order::Unordered), - "ORDER_ORDERED" => Ok(Order::Ordered), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for Packet { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.sequence != 0 { - len += 1; - } - if !self.source_port.is_empty() { - len += 1; - } - if !self.source_channel.is_empty() { - len += 1; - } - if !self.destination_port.is_empty() { - len += 1; - } - if !self.destination_channel.is_empty() { - len += 1; - } - if !self.data.is_empty() { - len += 1; - } - if self.timeout_height.is_some() { - len += 1; - } - if self.timeout_timestamp != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.Packet", len)?; - if self.sequence != 0 { - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - if !self.source_port.is_empty() { - struct_ser.serialize_field("sourcePort", &self.source_port)?; - } - if !self.source_channel.is_empty() { - struct_ser.serialize_field("sourceChannel", &self.source_channel)?; - } - if !self.destination_port.is_empty() { - struct_ser.serialize_field("destinationPort", &self.destination_port)?; - } - if !self.destination_channel.is_empty() { - struct_ser.serialize_field("destinationChannel", &self.destination_channel)?; - } - if !self.data.is_empty() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - if let Some(v) = self.timeout_height.as_ref() { - struct_ser.serialize_field("timeoutHeight", v)?; - } - if self.timeout_timestamp != 0 { - struct_ser.serialize_field( - "timeoutTimestamp", - ToString::to_string(&self.timeout_timestamp).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Packet { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "sequence", - "source_port", - "sourcePort", - "source_channel", - "sourceChannel", - "destination_port", - "destinationPort", - "destination_channel", - "destinationChannel", - "data", - "timeout_height", - "timeoutHeight", - "timeout_timestamp", - "timeoutTimestamp", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Sequence, - SourcePort, - SourceChannel, - DestinationPort, - DestinationChannel, - Data, - TimeoutHeight, - TimeoutTimestamp, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "sequence" => Ok(GeneratedField::Sequence), - "sourcePort" | "source_port" => Ok(GeneratedField::SourcePort), - "sourceChannel" | "source_channel" => Ok(GeneratedField::SourceChannel), - "destinationPort" | "destination_port" => { - Ok(GeneratedField::DestinationPort) - } - "destinationChannel" | "destination_channel" => { - Ok(GeneratedField::DestinationChannel) - } - "data" => Ok(GeneratedField::Data), - "timeoutHeight" | "timeout_height" => Ok(GeneratedField::TimeoutHeight), - "timeoutTimestamp" | "timeout_timestamp" => { - Ok(GeneratedField::TimeoutTimestamp) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Packet; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.Packet") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sequence__ = None; - let mut source_port__ = None; - let mut source_channel__ = None; - let mut destination_port__ = None; - let mut destination_channel__ = None; - let mut data__ = None; - let mut timeout_height__ = None; - let mut timeout_timestamp__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::SourcePort => { - if source_port__.is_some() { - return Err(serde::de::Error::duplicate_field("sourcePort")); - } - source_port__ = Some(map.next_value()?); - } - GeneratedField::SourceChannel => { - if source_channel__.is_some() { - return Err(serde::de::Error::duplicate_field("sourceChannel")); - } - source_channel__ = Some(map.next_value()?); - } - GeneratedField::DestinationPort => { - if destination_port__.is_some() { - return Err(serde::de::Error::duplicate_field("destinationPort")); - } - destination_port__ = Some(map.next_value()?); - } - GeneratedField::DestinationChannel => { - if destination_channel__.is_some() { - return Err(serde::de::Error::duplicate_field( - "destinationChannel", - )); - } - destination_channel__ = Some(map.next_value()?); - } - GeneratedField::Data => { - if data__.is_some() { - return Err(serde::de::Error::duplicate_field("data")); - } - data__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::TimeoutHeight => { - if timeout_height__.is_some() { - return Err(serde::de::Error::duplicate_field("timeoutHeight")); - } - timeout_height__ = map.next_value()?; - } - GeneratedField::TimeoutTimestamp => { - if timeout_timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timeoutTimestamp")); - } - timeout_timestamp__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(Packet { - sequence: sequence__.unwrap_or_default(), - source_port: source_port__.unwrap_or_default(), - source_channel: source_channel__.unwrap_or_default(), - destination_port: destination_port__.unwrap_or_default(), - destination_channel: destination_channel__.unwrap_or_default(), - data: data__.unwrap_or_default(), - timeout_height: timeout_height__, - timeout_timestamp: timeout_timestamp__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("ibc.core.channel.v1.Packet", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for PacketId { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if self.sequence != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.PacketId", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if self.sequence != 0 { - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PacketId { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId", "sequence"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - Sequence, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "sequence" => Ok(GeneratedField::Sequence), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PacketId; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.PacketId") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut sequence__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(PacketId { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - sequence: sequence__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("ibc.core.channel.v1.PacketId", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for PacketSequence { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if self.sequence != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.PacketSequence", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if self.sequence != 0 { - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PacketSequence { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId", "sequence"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - Sequence, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "sequence" => Ok(GeneratedField::Sequence), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PacketSequence; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.PacketSequence") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut sequence__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(PacketSequence { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - sequence: sequence__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.PacketSequence", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for PacketState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if self.sequence != 0 { - len += 1; - } - if !self.data.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.PacketState", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if self.sequence != 0 { - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - if !self.data.is_empty() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PacketState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "port_id", - "portId", - "channel_id", - "channelId", - "sequence", - "data", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - Sequence, - Data, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "sequence" => Ok(GeneratedField::Sequence), - "data" => Ok(GeneratedField::Data), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PacketState; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.PacketState") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut sequence__ = None; - let mut data__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Data => { - if data__.is_some() { - return Err(serde::de::Error::duplicate_field("data")); - } - data__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - } - } - Ok(PacketState { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - sequence: sequence__.unwrap_or_default(), - data: data__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("ibc.core.channel.v1.PacketState", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryChannelClientStateRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryChannelClientStateRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryChannelClientStateRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryChannelClientStateRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryChannelClientStateRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - } - } - Ok(QueryChannelClientStateRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryChannelClientStateRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryChannelClientStateResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.identified_client_state.is_some() { - len += 1; - } - if !self.proof.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryChannelClientStateResponse", len)?; - if let Some(v) = self.identified_client_state.as_ref() { - struct_ser.serialize_field("identifiedClientState", v)?; - } - if !self.proof.is_empty() { - struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryChannelClientStateResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "identified_client_state", - "identifiedClientState", - "proof", - "proof_height", - "proofHeight", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - IdentifiedClientState, - Proof, - ProofHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "identifiedClientState" | "identified_client_state" => { - Ok(GeneratedField::IdentifiedClientState) - } - "proof" => Ok(GeneratedField::Proof), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryChannelClientStateResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryChannelClientStateResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut identified_client_state__ = None; - let mut proof__ = None; - let mut proof_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::IdentifiedClientState => { - if identified_client_state__.is_some() { - return Err(serde::de::Error::duplicate_field( - "identifiedClientState", - )); - } - identified_client_state__ = map.next_value()?; - } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); - } - proof__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - } - } - Ok(QueryChannelClientStateResponse { - identified_client_state: identified_client_state__, - proof: proof__.unwrap_or_default(), - proof_height: proof_height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryChannelClientStateResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryChannelConsensusStateRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if self.revision_number != 0 { - len += 1; - } - if self.revision_height != 0 { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryChannelConsensusStateRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if self.revision_number != 0 { - struct_ser.serialize_field( - "revisionNumber", - ToString::to_string(&self.revision_number).as_str(), - )?; - } - if self.revision_height != 0 { - struct_ser.serialize_field( - "revisionHeight", - ToString::to_string(&self.revision_height).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryChannelConsensusStateRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "port_id", - "portId", - "channel_id", - "channelId", - "revision_number", - "revisionNumber", - "revision_height", - "revisionHeight", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - RevisionNumber, - RevisionHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "revisionNumber" | "revision_number" => { - Ok(GeneratedField::RevisionNumber) - } - "revisionHeight" | "revision_height" => { - Ok(GeneratedField::RevisionHeight) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryChannelConsensusStateRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryChannelConsensusStateRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut revision_number__ = None; - let mut revision_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::RevisionNumber => { - if revision_number__.is_some() { - return Err(serde::de::Error::duplicate_field("revisionNumber")); - } - revision_number__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::RevisionHeight => { - if revision_height__.is_some() { - return Err(serde::de::Error::duplicate_field("revisionHeight")); - } - revision_height__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(QueryChannelConsensusStateRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - revision_number: revision_number__.unwrap_or_default(), - revision_height: revision_height__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryChannelConsensusStateRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryChannelConsensusStateResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.consensus_state.is_some() { - len += 1; - } - if !self.client_id.is_empty() { - len += 1; - } - if !self.proof.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.core.channel.v1.QueryChannelConsensusStateResponse", - len, - )?; - if let Some(v) = self.consensus_state.as_ref() { - struct_ser.serialize_field("consensusState", v)?; - } - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - if !self.proof.is_empty() { - struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryChannelConsensusStateResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "consensus_state", - "consensusState", - "client_id", - "clientId", - "proof", - "proof_height", - "proofHeight", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ConsensusState, - ClientId, - Proof, - ProofHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "consensusState" | "consensus_state" => { - Ok(GeneratedField::ConsensusState) - } - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "proof" => Ok(GeneratedField::Proof), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryChannelConsensusStateResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryChannelConsensusStateResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut consensus_state__ = None; - let mut client_id__ = None; - let mut proof__ = None; - let mut proof_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ConsensusState => { - if consensus_state__.is_some() { - return Err(serde::de::Error::duplicate_field("consensusState")); - } - consensus_state__ = map.next_value()?; - } - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); - } - proof__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - } - } - Ok(QueryChannelConsensusStateResponse { - consensus_state: consensus_state__, - client_id: client_id__.unwrap_or_default(), - proof: proof__.unwrap_or_default(), - proof_height: proof_height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryChannelConsensusStateResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryChannelRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.QueryChannelRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryChannelRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryChannelRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryChannelRequest") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - } - } - Ok(QueryChannelRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryChannelRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryChannelResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.channel.is_some() { - len += 1; - } - if !self.proof.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.QueryChannelResponse", len)?; - if let Some(v) = self.channel.as_ref() { - struct_ser.serialize_field("channel", v)?; - } - if !self.proof.is_empty() { - struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryChannelResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["channel", "proof", "proof_height", "proofHeight"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Channel, - Proof, - ProofHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "proof" => Ok(GeneratedField::Proof), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryChannelResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryChannelResponse") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut channel__ = None; - let mut proof__ = None; - let mut proof_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Channel => { - if channel__.is_some() { - return Err(serde::de::Error::duplicate_field("channel")); - } - channel__ = map.next_value()?; - } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); - } - proof__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - } - } - Ok(QueryChannelResponse { - channel: channel__, - proof: proof__.unwrap_or_default(), - proof_height: proof_height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryChannelResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryChannelsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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("ibc.core.channel.v1.QueryChannelsRequest", len)?; - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryChannelsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["pagination"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = QueryChannelsRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryChannelsRequest") - } - - 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(QueryChannelsRequest { - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryChannelsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryChannelsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.channels.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - if self.height.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.QueryChannelsResponse", len)?; - if !self.channels.is_empty() { - struct_ser.serialize_field("channels", &self.channels)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - if let Some(v) = self.height.as_ref() { - struct_ser.serialize_field("height", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryChannelsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["channels", "pagination", "height"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Channels, - Pagination, - Height, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "channels" => Ok(GeneratedField::Channels), - "pagination" => Ok(GeneratedField::Pagination), - "height" => Ok(GeneratedField::Height), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryChannelsResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryChannelsResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut channels__ = None; - let mut pagination__ = None; - let mut height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Channels => { - if channels__.is_some() { - return Err(serde::de::Error::duplicate_field("channels")); - } - channels__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); - } - height__ = map.next_value()?; - } - } - } - Ok(QueryChannelsResponse { - channels: channels__.unwrap_or_default(), - pagination: pagination__, - height: height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryChannelsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryConnectionChannelsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.connection.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryConnectionChannelsRequest", len)?; - if !self.connection.is_empty() { - struct_ser.serialize_field("connection", &self.connection)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryConnectionChannelsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["connection", "pagination"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Connection, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "connection" => Ok(GeneratedField::Connection), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryConnectionChannelsRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryConnectionChannelsRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut connection__ = None; - let mut pagination__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Connection => { - if connection__.is_some() { - return Err(serde::de::Error::duplicate_field("connection")); - } - connection__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - } - } - Ok(QueryConnectionChannelsRequest { - connection: connection__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryConnectionChannelsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryConnectionChannelsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.channels.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - if self.height.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryConnectionChannelsResponse", len)?; - if !self.channels.is_empty() { - struct_ser.serialize_field("channels", &self.channels)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - if let Some(v) = self.height.as_ref() { - struct_ser.serialize_field("height", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryConnectionChannelsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["channels", "pagination", "height"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Channels, - Pagination, - Height, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "channels" => Ok(GeneratedField::Channels), - "pagination" => Ok(GeneratedField::Pagination), - "height" => Ok(GeneratedField::Height), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryConnectionChannelsResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryConnectionChannelsResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut channels__ = None; - let mut pagination__ = None; - let mut height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Channels => { - if channels__.is_some() { - return Err(serde::de::Error::duplicate_field("channels")); - } - channels__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); - } - height__ = map.next_value()?; - } - } - } - Ok(QueryConnectionChannelsResponse { - channels: channels__.unwrap_or_default(), - pagination: pagination__, - height: height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryConnectionChannelsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryNextSequenceReceiveRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryNextSequenceReceiveRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryNextSequenceReceiveRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryNextSequenceReceiveRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryNextSequenceReceiveRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - } - } - Ok(QueryNextSequenceReceiveRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryNextSequenceReceiveRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryNextSequenceReceiveResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.next_sequence_receive != 0 { - len += 1; - } - if !self.proof.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryNextSequenceReceiveResponse", len)?; - if self.next_sequence_receive != 0 { - struct_ser.serialize_field( - "nextSequenceReceive", - ToString::to_string(&self.next_sequence_receive).as_str(), - )?; - } - if !self.proof.is_empty() { - struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryNextSequenceReceiveResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "next_sequence_receive", - "nextSequenceReceive", - "proof", - "proof_height", - "proofHeight", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - NextSequenceReceive, - Proof, - ProofHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "nextSequenceReceive" | "next_sequence_receive" => { - Ok(GeneratedField::NextSequenceReceive) - } - "proof" => Ok(GeneratedField::Proof), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryNextSequenceReceiveResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryNextSequenceReceiveResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut next_sequence_receive__ = None; - let mut proof__ = None; - let mut proof_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::NextSequenceReceive => { - if next_sequence_receive__.is_some() { - return Err(serde::de::Error::duplicate_field( - "nextSequenceReceive", - )); - } - next_sequence_receive__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); - } - proof__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - } - } - Ok(QueryNextSequenceReceiveResponse { - next_sequence_receive: next_sequence_receive__.unwrap_or_default(), - proof: proof__.unwrap_or_default(), - proof_height: proof_height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryNextSequenceReceiveResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryPacketAcknowledgementRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if self.sequence != 0 { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryPacketAcknowledgementRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if self.sequence != 0 { - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId", "sequence"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - Sequence, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "sequence" => Ok(GeneratedField::Sequence), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPacketAcknowledgementRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryPacketAcknowledgementRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut sequence__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(QueryPacketAcknowledgementRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - sequence: sequence__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryPacketAcknowledgementRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryPacketAcknowledgementResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.acknowledgement.is_empty() { - len += 1; - } - if !self.proof.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.core.channel.v1.QueryPacketAcknowledgementResponse", - len, - )?; - if !self.acknowledgement.is_empty() { - struct_ser.serialize_field( - "acknowledgement", - pbjson::private::base64::encode(&self.acknowledgement).as_str(), - )?; - } - if !self.proof.is_empty() { - struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["acknowledgement", "proof", "proof_height", "proofHeight"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Acknowledgement, - Proof, - ProofHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "acknowledgement" => Ok(GeneratedField::Acknowledgement), - "proof" => Ok(GeneratedField::Proof), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPacketAcknowledgementResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryPacketAcknowledgementResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut acknowledgement__ = None; - let mut proof__ = None; - let mut proof_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Acknowledgement => { - if acknowledgement__.is_some() { - return Err(serde::de::Error::duplicate_field("acknowledgement")); - } - acknowledgement__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); - } - proof__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - } - } - Ok(QueryPacketAcknowledgementResponse { - acknowledgement: acknowledgement__.unwrap_or_default(), - proof: proof__.unwrap_or_default(), - proof_height: proof_height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryPacketAcknowledgementResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryPacketAcknowledgementsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - if !self.packet_commitment_sequences.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.core.channel.v1.QueryPacketAcknowledgementsRequest", - len, - )?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - if !self.packet_commitment_sequences.is_empty() { - struct_ser.serialize_field( - "packetCommitmentSequences", - &self - .packet_commitment_sequences - .iter() - .map(ToString::to_string) - .collect::>(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "port_id", - "portId", - "channel_id", - "channelId", - "pagination", - "packet_commitment_sequences", - "packetCommitmentSequences", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - Pagination, - PacketCommitmentSequences, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "pagination" => Ok(GeneratedField::Pagination), - "packetCommitmentSequences" | "packet_commitment_sequences" => { - Ok(GeneratedField::PacketCommitmentSequences) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPacketAcknowledgementsRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryPacketAcknowledgementsRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut pagination__ = None; - let mut packet_commitment_sequences__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - GeneratedField::PacketCommitmentSequences => { - if packet_commitment_sequences__.is_some() { - return Err(serde::de::Error::duplicate_field( - "packetCommitmentSequences", - )); - } - packet_commitment_sequences__ = Some( - map.next_value::>>()? - .into_iter() - .map(|x| x.0) - .collect(), - ); - } - } - } - Ok(QueryPacketAcknowledgementsRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - pagination: pagination__, - packet_commitment_sequences: packet_commitment_sequences__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryPacketAcknowledgementsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryPacketAcknowledgementsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.acknowledgements.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - if self.height.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.core.channel.v1.QueryPacketAcknowledgementsResponse", - len, - )?; - if !self.acknowledgements.is_empty() { - struct_ser.serialize_field("acknowledgements", &self.acknowledgements)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - if let Some(v) = self.height.as_ref() { - struct_ser.serialize_field("height", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["acknowledgements", "pagination", "height"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Acknowledgements, - Pagination, - Height, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "acknowledgements" => Ok(GeneratedField::Acknowledgements), - "pagination" => Ok(GeneratedField::Pagination), - "height" => Ok(GeneratedField::Height), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPacketAcknowledgementsResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct ibc.core.channel.v1.QueryPacketAcknowledgementsResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut acknowledgements__ = None; - let mut pagination__ = None; - let mut height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Acknowledgements => { - if acknowledgements__.is_some() { - return Err(serde::de::Error::duplicate_field("acknowledgements")); - } - acknowledgements__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); - } - height__ = map.next_value()?; - } - } - } - Ok(QueryPacketAcknowledgementsResponse { - acknowledgements: acknowledgements__.unwrap_or_default(), - pagination: pagination__, - height: height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryPacketAcknowledgementsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryPacketCommitmentRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if self.sequence != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.QueryPacketCommitmentRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if self.sequence != 0 { - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId", "sequence"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - Sequence, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "sequence" => Ok(GeneratedField::Sequence), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPacketCommitmentRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryPacketCommitmentRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut sequence__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(QueryPacketCommitmentRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - sequence: sequence__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryPacketCommitmentRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryPacketCommitmentResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.commitment.is_empty() { - len += 1; - } - if !self.proof.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryPacketCommitmentResponse", len)?; - if !self.commitment.is_empty() { - struct_ser.serialize_field( - "commitment", - pbjson::private::base64::encode(&self.commitment).as_str(), - )?; - } - if !self.proof.is_empty() { - struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["commitment", "proof", "proof_height", "proofHeight"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Commitment, - Proof, - ProofHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "commitment" => Ok(GeneratedField::Commitment), - "proof" => Ok(GeneratedField::Proof), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPacketCommitmentResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryPacketCommitmentResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut commitment__ = None; - let mut proof__ = None; - let mut proof_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Commitment => { - if commitment__.is_some() { - return Err(serde::de::Error::duplicate_field("commitment")); - } - commitment__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); - } - proof__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - } - } - Ok(QueryPacketCommitmentResponse { - commitment: commitment__.unwrap_or_default(), - proof: proof__.unwrap_or_default(), - proof_height: proof_height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryPacketCommitmentResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryPacketCommitmentsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryPacketCommitmentsRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId", "pagination"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPacketCommitmentsRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryPacketCommitmentsRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut pagination__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - } - } - Ok(QueryPacketCommitmentsRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryPacketCommitmentsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryPacketCommitmentsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.commitments.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - if self.height.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryPacketCommitmentsResponse", len)?; - if !self.commitments.is_empty() { - struct_ser.serialize_field("commitments", &self.commitments)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - if let Some(v) = self.height.as_ref() { - struct_ser.serialize_field("height", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["commitments", "pagination", "height"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Commitments, - Pagination, - Height, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "commitments" => Ok(GeneratedField::Commitments), - "pagination" => Ok(GeneratedField::Pagination), - "height" => Ok(GeneratedField::Height), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPacketCommitmentsResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryPacketCommitmentsResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut commitments__ = None; - let mut pagination__ = None; - let mut height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Commitments => { - if commitments__.is_some() { - return Err(serde::de::Error::duplicate_field("commitments")); - } - commitments__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); - } - height__ = map.next_value()?; - } - } - } - Ok(QueryPacketCommitmentsResponse { - commitments: commitments__.unwrap_or_default(), - pagination: pagination__, - height: height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryPacketCommitmentsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryPacketReceiptRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if self.sequence != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.QueryPacketReceiptRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if self.sequence != 0 { - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryPacketReceiptRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId", "sequence"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - Sequence, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "sequence" => Ok(GeneratedField::Sequence), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPacketReceiptRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryPacketReceiptRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut sequence__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(QueryPacketReceiptRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - sequence: sequence__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryPacketReceiptRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryPacketReceiptResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.received { - len += 1; - } - if !self.proof.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.QueryPacketReceiptResponse", len)?; - if self.received { - struct_ser.serialize_field("received", &self.received)?; - } - if !self.proof.is_empty() { - struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryPacketReceiptResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["received", "proof", "proof_height", "proofHeight"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Received, - Proof, - ProofHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "received" => Ok(GeneratedField::Received), - "proof" => Ok(GeneratedField::Proof), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPacketReceiptResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryPacketReceiptResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut received__ = None; - let mut proof__ = None; - let mut proof_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Received => { - if received__.is_some() { - return Err(serde::de::Error::duplicate_field("received")); - } - received__ = Some(map.next_value()?); - } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); - } - proof__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - } - } - Ok(QueryPacketReceiptResponse { - received: received__.unwrap_or_default(), - proof: proof__.unwrap_or_default(), - proof_height: proof_height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryPacketReceiptResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryUnreceivedAcksRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if !self.packet_ack_sequences.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.QueryUnreceivedAcksRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if !self.packet_ack_sequences.is_empty() { - struct_ser.serialize_field( - "packetAckSequences", - &self - .packet_ack_sequences - .iter() - .map(ToString::to_string) - .collect::>(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryUnreceivedAcksRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "port_id", - "portId", - "channel_id", - "channelId", - "packet_ack_sequences", - "packetAckSequences", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - PacketAckSequences, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "packetAckSequences" | "packet_ack_sequences" => { - Ok(GeneratedField::PacketAckSequences) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryUnreceivedAcksRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryUnreceivedAcksRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut packet_ack_sequences__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::PacketAckSequences => { - if packet_ack_sequences__.is_some() { - return Err(serde::de::Error::duplicate_field( - "packetAckSequences", - )); - } - packet_ack_sequences__ = Some( - map.next_value::>>()? - .into_iter() - .map(|x| x.0) - .collect(), - ); - } - } - } - Ok(QueryUnreceivedAcksRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - packet_ack_sequences: packet_ack_sequences__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryUnreceivedAcksRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryUnreceivedAcksResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.sequences.is_empty() { - len += 1; - } - if self.height.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.QueryUnreceivedAcksResponse", len)?; - if !self.sequences.is_empty() { - struct_ser.serialize_field( - "sequences", - &self - .sequences - .iter() - .map(ToString::to_string) - .collect::>(), - )?; - } - if let Some(v) = self.height.as_ref() { - struct_ser.serialize_field("height", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryUnreceivedAcksResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["sequences", "height"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Sequences, - Height, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "sequences" => Ok(GeneratedField::Sequences), - "height" => Ok(GeneratedField::Height), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryUnreceivedAcksResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryUnreceivedAcksResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sequences__ = None; - let mut height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Sequences => { - if sequences__.is_some() { - return Err(serde::de::Error::duplicate_field("sequences")); - } - sequences__ = Some( - map.next_value::>>()? - .into_iter() - .map(|x| x.0) - .collect(), - ); - } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); - } - height__ = map.next_value()?; - } - } - } - Ok(QueryUnreceivedAcksResponse { - sequences: sequences__.unwrap_or_default(), - height: height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryUnreceivedAcksResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryUnreceivedPacketsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if !self.packet_commitment_sequences.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryUnreceivedPacketsRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if !self.packet_commitment_sequences.is_empty() { - struct_ser.serialize_field( - "packetCommitmentSequences", - &self - .packet_commitment_sequences - .iter() - .map(ToString::to_string) - .collect::>(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryUnreceivedPacketsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "port_id", - "portId", - "channel_id", - "channelId", - "packet_commitment_sequences", - "packetCommitmentSequences", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - PacketCommitmentSequences, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "packetCommitmentSequences" | "packet_commitment_sequences" => { - Ok(GeneratedField::PacketCommitmentSequences) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryUnreceivedPacketsRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryUnreceivedPacketsRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut packet_commitment_sequences__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map.next_value()?); - } - GeneratedField::PacketCommitmentSequences => { - if packet_commitment_sequences__.is_some() { - return Err(serde::de::Error::duplicate_field( - "packetCommitmentSequences", - )); - } - packet_commitment_sequences__ = Some( - map.next_value::>>()? - .into_iter() - .map(|x| x.0) - .collect(), - ); - } - } - } - Ok(QueryUnreceivedPacketsRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - packet_commitment_sequences: packet_commitment_sequences__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryUnreceivedPacketsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryUnreceivedPacketsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.sequences.is_empty() { - len += 1; - } - if self.height.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryUnreceivedPacketsResponse", len)?; - if !self.sequences.is_empty() { - struct_ser.serialize_field( - "sequences", - &self - .sequences - .iter() - .map(ToString::to_string) - .collect::>(), - )?; - } - if let Some(v) = self.height.as_ref() { - struct_ser.serialize_field("height", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryUnreceivedPacketsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["sequences", "height"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Sequences, - Height, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "sequences" => Ok(GeneratedField::Sequences), - "height" => Ok(GeneratedField::Height), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryUnreceivedPacketsResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryUnreceivedPacketsResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sequences__ = None; - let mut height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Sequences => { - if sequences__.is_some() { - return Err(serde::de::Error::duplicate_field("sequences")); - } - sequences__ = Some( - map.next_value::>>()? - .into_iter() - .map(|x| x.0) - .collect(), - ); - } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); - } - height__ = map.next_value()?; - } - } - } - Ok(QueryUnreceivedPacketsResponse { - sequences: sequences__.unwrap_or_default(), - height: height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryUnreceivedPacketsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ResponseResultType { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::Unspecified => "RESPONSE_RESULT_TYPE_UNSPECIFIED", - Self::Noop => "RESPONSE_RESULT_TYPE_NOOP", - Self::Success => "RESPONSE_RESULT_TYPE_SUCCESS", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for ResponseResultType { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "RESPONSE_RESULT_TYPE_UNSPECIFIED", - "RESPONSE_RESULT_TYPE_NOOP", - "RESPONSE_RESULT_TYPE_SUCCESS", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ResponseResultType; - - fn expecting(&self, formatter: &mut 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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ResponseResultType::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(ResponseResultType::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "RESPONSE_RESULT_TYPE_UNSPECIFIED" => Ok(ResponseResultType::Unspecified), - "RESPONSE_RESULT_TYPE_NOOP" => Ok(ResponseResultType::Noop), - "RESPONSE_RESULT_TYPE_SUCCESS" => Ok(ResponseResultType::Success), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for State { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::UninitializedUnspecified => "STATE_UNINITIALIZED_UNSPECIFIED", - Self::Init => "STATE_INIT", - Self::Tryopen => "STATE_TRYOPEN", - Self::Open => "STATE_OPEN", - Self::Closed => "STATE_CLOSED", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for State { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "STATE_UNINITIALIZED_UNSPECIFIED", - "STATE_INIT", - "STATE_TRYOPEN", - "STATE_OPEN", - "STATE_CLOSED", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = State; - - fn expecting(&self, formatter: &mut 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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(State::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(State::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "STATE_UNINITIALIZED_UNSPECIFIED" => Ok(State::UninitializedUnspecified), - "STATE_INIT" => Ok(State::Init), - "STATE_TRYOPEN" => Ok(State::Tryopen), - "STATE_OPEN" => Ok(State::Open), - "STATE_CLOSED" => Ok(State::Closed), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/ibc.core.client.v1.rs b/packages/proto/src/gen/ibc.core.client.v1.rs index ab4442f..15d8273 100644 --- a/packages/proto/src/gen/ibc.core.client.v1.rs +++ b/packages/proto/src/gen/ibc.core.client.v1.rs @@ -1,6 +1,7 @@ // @generated /// IdentifiedClientState defines a client state with an additional client /// identifier field. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IdentifiedClientState { @@ -20,6 +21,7 @@ impl ::prost::Name for IdentifiedClientState { } /// ConsensusStateWithHeight defines a consensus state with an additional height /// field. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConsensusStateWithHeight { @@ -39,6 +41,7 @@ impl ::prost::Name for ConsensusStateWithHeight { } /// ClientConsensusStates defines all the stored consensus states for a given /// client. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientConsensusStates { @@ -60,6 +63,7 @@ impl ::prost::Name for ClientConsensusStates { /// client's latest consensus state is copied over to the subject client. The proposal /// handler may fail if the subject and the substitute do not match in client and /// chain parameters (with exception to latest height, frozen height, and chain-id). +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientUpdateProposal { @@ -86,6 +90,7 @@ impl ::prost::Name for ClientUpdateProposal { } /// UpgradeProposal is a gov Content type for initiating an IBC breaking /// upgrade. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpgradeProposal { @@ -121,6 +126,7 @@ impl ::prost::Name for UpgradeProposal { /// breaking changes In these cases, the RevisionNumber is incremented so that /// height continues to be monitonically increasing even as the RevisionHeight /// gets reset +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Height { @@ -139,6 +145,7 @@ impl ::prost::Name for Height { } } /// Params defines the set of IBC light client parameters. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -156,6 +163,7 @@ impl ::prost::Name for Params { } } /// GenesisState defines the ibc client submodule's genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -186,6 +194,7 @@ impl ::prost::Name for GenesisState { } /// GenesisMetadata defines the genesis type for metadata that clients may return /// with ExportMetadata +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisMetadata { @@ -205,6 +214,7 @@ impl ::prost::Name for GenesisMetadata { } /// IdentifiedGenesisMetadata has the client metadata with the corresponding /// client id. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IdentifiedGenesisMetadata { @@ -222,6 +232,7 @@ impl ::prost::Name for IdentifiedGenesisMetadata { } /// QueryClientStateRequest is the request type for the Query/ClientState RPC /// method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientStateRequest { @@ -239,6 +250,7 @@ impl ::prost::Name for QueryClientStateRequest { /// QueryClientStateResponse is the response type for the Query/ClientState RPC /// method. Besides the client state, it includes a proof and the height from /// which the proof was retrieved. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientStateResponse { @@ -261,6 +273,7 @@ impl ::prost::Name for QueryClientStateResponse { } /// QueryClientStatesRequest is the request type for the Query/ClientStates RPC /// method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientStatesRequest { @@ -279,6 +292,7 @@ impl ::prost::Name for QueryClientStatesRequest { } /// QueryClientStatesResponse is the response type for the Query/ClientStates RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientStatesResponse { @@ -301,6 +315,7 @@ impl ::prost::Name for QueryClientStatesResponse { /// QueryConsensusStateRequest is the request type for the Query/ConsensusState /// RPC method. Besides the consensus state, it includes a proof and the height /// from which the proof was retrieved. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsensusStateRequest { @@ -327,6 +342,7 @@ impl ::prost::Name for QueryConsensusStateRequest { } /// QueryConsensusStateResponse is the response type for the Query/ConsensusState /// RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsensusStateResponse { @@ -349,6 +365,7 @@ impl ::prost::Name for QueryConsensusStateResponse { } /// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates /// RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsensusStatesRequest { @@ -370,6 +387,7 @@ impl ::prost::Name for QueryConsensusStatesRequest { } /// QueryConsensusStatesResponse is the response type for the /// Query/ConsensusStates RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsensusStatesResponse { @@ -391,6 +409,7 @@ impl ::prost::Name for QueryConsensusStatesResponse { } /// QueryConsensusStateHeightsRequest is the request type for Query/ConsensusStateHeights /// RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsensusStateHeightsRequest { @@ -412,6 +431,7 @@ impl ::prost::Name for QueryConsensusStateHeightsRequest { } /// QueryConsensusStateHeightsResponse is the response type for the /// Query/ConsensusStateHeights RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConsensusStateHeightsResponse { @@ -433,6 +453,7 @@ impl ::prost::Name for QueryConsensusStateHeightsResponse { } /// QueryClientStatusRequest is the request type for the Query/ClientStatus RPC /// method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientStatusRequest { @@ -449,6 +470,7 @@ impl ::prost::Name for QueryClientStatusRequest { } /// QueryClientStatusResponse is the response type for the Query/ClientStatus RPC /// method. It returns the current status of the IBC client. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientStatusResponse { @@ -464,6 +486,7 @@ impl ::prost::Name for QueryClientStatusResponse { } /// QueryClientParamsRequest is the request type for the Query/ClientParams RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientParamsRequest {} @@ -476,6 +499,7 @@ impl ::prost::Name for QueryClientParamsRequest { } /// QueryClientParamsResponse is the response type for the Query/ClientParams RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientParamsResponse { @@ -492,6 +516,7 @@ impl ::prost::Name for QueryClientParamsResponse { } /// QueryUpgradedClientStateRequest is the request type for the /// Query/UpgradedClientState RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradedClientStateRequest {} @@ -504,6 +529,7 @@ impl ::prost::Name for QueryUpgradedClientStateRequest { } /// QueryUpgradedClientStateResponse is the response type for the /// Query/UpgradedClientState RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradedClientStateResponse { @@ -520,6 +546,7 @@ impl ::prost::Name for QueryUpgradedClientStateResponse { } /// QueryUpgradedConsensusStateRequest is the request type for the /// Query/UpgradedConsensusState RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradedConsensusStateRequest {} @@ -532,6 +559,7 @@ impl ::prost::Name for QueryUpgradedConsensusStateRequest { } /// QueryUpgradedConsensusStateResponse is the response type for the /// Query/UpgradedConsensusState RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradedConsensusStateResponse { @@ -547,6 +575,7 @@ impl ::prost::Name for QueryUpgradedConsensusStateResponse { } } /// MsgCreateClient defines a message to create an IBC client +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateClient { @@ -569,6 +598,7 @@ impl ::prost::Name for MsgCreateClient { } } /// MsgCreateClientResponse defines the Msg/CreateClient response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateClientResponse {} @@ -581,6 +611,7 @@ impl ::prost::Name for MsgCreateClientResponse { } /// MsgUpdateClient defines an sdk.Msg to update a IBC client state using /// the given client message. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateClient { @@ -602,6 +633,7 @@ impl ::prost::Name for MsgUpdateClient { } } /// MsgUpdateClientResponse defines the Msg/UpdateClient response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateClientResponse {} @@ -614,6 +646,7 @@ impl ::prost::Name for MsgUpdateClientResponse { } /// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client /// state +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpgradeClient { @@ -645,6 +678,7 @@ impl ::prost::Name for MsgUpgradeClient { } } /// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpgradeClientResponse {} @@ -658,6 +692,7 @@ impl ::prost::Name for MsgUpgradeClientResponse { /// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for /// light client misbehaviour. /// Warning: DEPRECATED +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitMisbehaviour { @@ -683,6 +718,7 @@ impl ::prost::Name for MsgSubmitMisbehaviour { } /// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response /// type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitMisbehaviourResponse {} @@ -2233,6 +2269,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x6f, 0x6e, 0x73, 0x65, 0x0a, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x0a, 0x0a, 0x0a, 0x0a, 0x03, 0x04, 0x07, 0x01, 0x12, 0x03, 0x63, 0x08, 0x25, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("ibc.core.client.v1.serde.rs"); include!("ibc.core.client.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/ibc.core.client.v1.serde.rs b/packages/proto/src/gen/ibc.core.client.v1.serde.rs deleted file mode 100644 index ee5ccab..0000000 --- a/packages/proto/src/gen/ibc.core.client.v1.serde.rs +++ /dev/null @@ -1,4264 +0,0 @@ -// @generated -impl serde::Serialize for ClientConsensusStates { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_id.is_empty() { - len += 1; - } - if !self.consensus_states.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.ClientConsensusStates", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - if !self.consensus_states.is_empty() { - struct_ser.serialize_field("consensusStates", &self.consensus_states)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ClientConsensusStates { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "client_id", - "clientId", - "consensus_states", - "consensusStates", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientId, - ConsensusStates, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "consensusStates" | "consensus_states" => { - Ok(GeneratedField::ConsensusStates) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ClientConsensusStates; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.ClientConsensusStates") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_id__ = None; - let mut consensus_states__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - GeneratedField::ConsensusStates => { - if consensus_states__.is_some() { - return Err(serde::de::Error::duplicate_field("consensusStates")); - } - consensus_states__ = Some(map.next_value()?); - } - } - } - Ok(ClientConsensusStates { - client_id: client_id__.unwrap_or_default(), - consensus_states: consensus_states__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.ClientConsensusStates", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ClientUpdateProposal { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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.subject_client_id.is_empty() { - len += 1; - } - if !self.substitute_client_id.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.ClientUpdateProposal", 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.subject_client_id.is_empty() { - struct_ser.serialize_field("subjectClientId", &self.subject_client_id)?; - } - if !self.substitute_client_id.is_empty() { - struct_ser.serialize_field("substituteClientId", &self.substitute_client_id)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ClientUpdateProposal { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "title", - "description", - "subject_client_id", - "subjectClientId", - "substitute_client_id", - "substituteClientId", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Title, - Description, - SubjectClientId, - SubstituteClientId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "subjectClientId" | "subject_client_id" => { - Ok(GeneratedField::SubjectClientId) - } - "substituteClientId" | "substitute_client_id" => { - Ok(GeneratedField::SubstituteClientId) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ClientUpdateProposal; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.ClientUpdateProposal") - } - - 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 subject_client_id__ = None; - let mut substitute_client_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Title => { - if title__.is_some() { - return Err(serde::de::Error::duplicate_field("title")); - } - title__ = Some(map.next_value()?); - } - GeneratedField::Description => { - if description__.is_some() { - return Err(serde::de::Error::duplicate_field("description")); - } - description__ = Some(map.next_value()?); - } - GeneratedField::SubjectClientId => { - if subject_client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("subjectClientId")); - } - subject_client_id__ = Some(map.next_value()?); - } - GeneratedField::SubstituteClientId => { - if substitute_client_id__.is_some() { - return Err(serde::de::Error::duplicate_field( - "substituteClientId", - )); - } - substitute_client_id__ = Some(map.next_value()?); - } - } - } - Ok(ClientUpdateProposal { - title: title__.unwrap_or_default(), - description: description__.unwrap_or_default(), - subject_client_id: subject_client_id__.unwrap_or_default(), - substitute_client_id: substitute_client_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.ClientUpdateProposal", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ConsensusStateWithHeight { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.height.is_some() { - len += 1; - } - if self.consensus_state.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.ConsensusStateWithHeight", len)?; - if let Some(v) = self.height.as_ref() { - struct_ser.serialize_field("height", v)?; - } - if let Some(v) = self.consensus_state.as_ref() { - struct_ser.serialize_field("consensusState", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ConsensusStateWithHeight { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["height", "consensus_state", "consensusState"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Height, - ConsensusState, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "consensusState" | "consensus_state" => { - Ok(GeneratedField::ConsensusState) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ConsensusStateWithHeight; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.ConsensusStateWithHeight") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut height__ = None; - let mut consensus_state__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); - } - height__ = map.next_value()?; - } - GeneratedField::ConsensusState => { - if consensus_state__.is_some() { - return Err(serde::de::Error::duplicate_field("consensusState")); - } - consensus_state__ = map.next_value()?; - } - } - } - Ok(ConsensusStateWithHeight { - height: height__, - consensus_state: consensus_state__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.ConsensusStateWithHeight", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for GenesisMetadata { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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("ibc.core.client.v1.GenesisMetadata", len)?; - if !self.key.is_empty() { - struct_ser - .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if !self.value.is_empty() { - struct_ser.serialize_field( - "value", - pbjson::private::base64::encode(&self.value).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GenesisMetadata { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["key", "value"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Value, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = GenesisMetadata; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.GenesisMetadata") - } - - 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(GenesisMetadata { - key: key__.unwrap_or_default(), - value: value__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.GenesisMetadata", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for GenesisState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.clients.is_empty() { - len += 1; - } - if !self.clients_consensus.is_empty() { - len += 1; - } - if !self.clients_metadata.is_empty() { - len += 1; - } - if self.params.is_some() { - len += 1; - } - if self.create_localhost { - len += 1; - } - if self.next_client_sequence != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("ibc.core.client.v1.GenesisState", len)?; - if !self.clients.is_empty() { - struct_ser.serialize_field("clients", &self.clients)?; - } - if !self.clients_consensus.is_empty() { - struct_ser.serialize_field("clientsConsensus", &self.clients_consensus)?; - } - if !self.clients_metadata.is_empty() { - struct_ser.serialize_field("clientsMetadata", &self.clients_metadata)?; - } - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - if self.create_localhost { - struct_ser.serialize_field("createLocalhost", &self.create_localhost)?; - } - if self.next_client_sequence != 0 { - struct_ser.serialize_field( - "nextClientSequence", - ToString::to_string(&self.next_client_sequence).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GenesisState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "clients", - "clients_consensus", - "clientsConsensus", - "clients_metadata", - "clientsMetadata", - "params", - "create_localhost", - "createLocalhost", - "next_client_sequence", - "nextClientSequence", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Clients, - ClientsConsensus, - ClientsMetadata, - Params, - CreateLocalhost, - NextClientSequence, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clients" => Ok(GeneratedField::Clients), - "clientsConsensus" | "clients_consensus" => { - Ok(GeneratedField::ClientsConsensus) - } - "clientsMetadata" | "clients_metadata" => { - Ok(GeneratedField::ClientsMetadata) - } - "params" => Ok(GeneratedField::Params), - "createLocalhost" | "create_localhost" => { - Ok(GeneratedField::CreateLocalhost) - } - "nextClientSequence" | "next_client_sequence" => { - Ok(GeneratedField::NextClientSequence) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GenesisState; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.GenesisState") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut clients__ = None; - let mut clients_consensus__ = None; - let mut clients_metadata__ = None; - let mut params__ = None; - let mut create_localhost__ = None; - let mut next_client_sequence__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Clients => { - if clients__.is_some() { - return Err(serde::de::Error::duplicate_field("clients")); - } - clients__ = Some(map.next_value()?); - } - GeneratedField::ClientsConsensus => { - if clients_consensus__.is_some() { - return Err(serde::de::Error::duplicate_field("clientsConsensus")); - } - clients_consensus__ = Some(map.next_value()?); - } - GeneratedField::ClientsMetadata => { - if clients_metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("clientsMetadata")); - } - clients_metadata__ = Some(map.next_value()?); - } - GeneratedField::Params => { - if params__.is_some() { - return Err(serde::de::Error::duplicate_field("params")); - } - params__ = map.next_value()?; - } - GeneratedField::CreateLocalhost => { - if create_localhost__.is_some() { - return Err(serde::de::Error::duplicate_field("createLocalhost")); - } - create_localhost__ = Some(map.next_value()?); - } - GeneratedField::NextClientSequence => { - if next_client_sequence__.is_some() { - return Err(serde::de::Error::duplicate_field( - "nextClientSequence", - )); - } - next_client_sequence__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(GenesisState { - clients: clients__.unwrap_or_default(), - clients_consensus: clients_consensus__.unwrap_or_default(), - clients_metadata: clients_metadata__.unwrap_or_default(), - params: params__, - create_localhost: create_localhost__.unwrap_or_default(), - next_client_sequence: next_client_sequence__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("ibc.core.client.v1.GenesisState", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Height { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.revision_number != 0 { - len += 1; - } - if self.revision_height != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("ibc.core.client.v1.Height", len)?; - if self.revision_number != 0 { - struct_ser.serialize_field( - "revisionNumber", - ToString::to_string(&self.revision_number).as_str(), - )?; - } - if self.revision_height != 0 { - struct_ser.serialize_field( - "revisionHeight", - ToString::to_string(&self.revision_height).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Height { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "revision_number", - "revisionNumber", - "revision_height", - "revisionHeight", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - RevisionNumber, - RevisionHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "revisionNumber" | "revision_number" => { - Ok(GeneratedField::RevisionNumber) - } - "revisionHeight" | "revision_height" => { - Ok(GeneratedField::RevisionHeight) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Height; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.Height") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut revision_number__ = None; - let mut revision_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::RevisionNumber => { - if revision_number__.is_some() { - return Err(serde::de::Error::duplicate_field("revisionNumber")); - } - revision_number__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::RevisionHeight => { - if revision_height__.is_some() { - return Err(serde::de::Error::duplicate_field("revisionHeight")); - } - revision_height__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(Height { - revision_number: revision_number__.unwrap_or_default(), - revision_height: revision_height__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("ibc.core.client.v1.Height", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for IdentifiedClientState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_id.is_empty() { - len += 1; - } - if self.client_state.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.IdentifiedClientState", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - if let Some(v) = self.client_state.as_ref() { - struct_ser.serialize_field("clientState", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for IdentifiedClientState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["client_id", "clientId", "client_state", "clientState"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientId, - ClientState, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "clientState" | "client_state" => Ok(GeneratedField::ClientState), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IdentifiedClientState; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.IdentifiedClientState") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_id__ = None; - let mut client_state__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - GeneratedField::ClientState => { - if client_state__.is_some() { - return Err(serde::de::Error::duplicate_field("clientState")); - } - client_state__ = map.next_value()?; - } - } - } - Ok(IdentifiedClientState { - client_id: client_id__.unwrap_or_default(), - client_state: client_state__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.IdentifiedClientState", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for IdentifiedGenesisMetadata { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_id.is_empty() { - len += 1; - } - if !self.client_metadata.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.IdentifiedGenesisMetadata", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - if !self.client_metadata.is_empty() { - struct_ser.serialize_field("clientMetadata", &self.client_metadata)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for IdentifiedGenesisMetadata { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["client_id", "clientId", "client_metadata", "clientMetadata"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientId, - ClientMetadata, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "clientMetadata" | "client_metadata" => { - Ok(GeneratedField::ClientMetadata) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IdentifiedGenesisMetadata; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.IdentifiedGenesisMetadata") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_id__ = None; - let mut client_metadata__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - GeneratedField::ClientMetadata => { - if client_metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("clientMetadata")); - } - client_metadata__ = Some(map.next_value()?); - } - } - } - Ok(IdentifiedGenesisMetadata { - client_id: client_id__.unwrap_or_default(), - client_metadata: client_metadata__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.IdentifiedGenesisMetadata", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgCreateClient { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.client_state.is_some() { - len += 1; - } - if self.consensus_state.is_some() { - len += 1; - } - if !self.signer.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.MsgCreateClient", len)?; - if let Some(v) = self.client_state.as_ref() { - struct_ser.serialize_field("clientState", v)?; - } - if let Some(v) = self.consensus_state.as_ref() { - struct_ser.serialize_field("consensusState", v)?; - } - if !self.signer.is_empty() { - struct_ser.serialize_field("signer", &self.signer)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgCreateClient { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "client_state", - "clientState", - "consensus_state", - "consensusState", - "signer", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientState, - ConsensusState, - Signer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientState" | "client_state" => Ok(GeneratedField::ClientState), - "consensusState" | "consensus_state" => { - Ok(GeneratedField::ConsensusState) - } - "signer" => Ok(GeneratedField::Signer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgCreateClient; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.MsgCreateClient") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_state__ = None; - let mut consensus_state__ = None; - let mut signer__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientState => { - if client_state__.is_some() { - return Err(serde::de::Error::duplicate_field("clientState")); - } - client_state__ = map.next_value()?; - } - GeneratedField::ConsensusState => { - if consensus_state__.is_some() { - return Err(serde::de::Error::duplicate_field("consensusState")); - } - consensus_state__ = map.next_value()?; - } - GeneratedField::Signer => { - if signer__.is_some() { - return Err(serde::de::Error::duplicate_field("signer")); - } - signer__ = Some(map.next_value()?); - } - } - } - Ok(MsgCreateClient { - client_state: client_state__, - consensus_state: consensus_state__, - signer: signer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.MsgCreateClient", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgCreateClientResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = - serializer.serialize_struct("ibc.core.client.v1.MsgCreateClientResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgCreateClientResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgCreateClientResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.MsgCreateClientResponse") - } - - 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(MsgCreateClientResponse {}) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.MsgCreateClientResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgSubmitMisbehaviour { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_id.is_empty() { - len += 1; - } - if self.misbehaviour.is_some() { - len += 1; - } - if !self.signer.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.MsgSubmitMisbehaviour", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - if let Some(v) = self.misbehaviour.as_ref() { - struct_ser.serialize_field("misbehaviour", v)?; - } - if !self.signer.is_empty() { - struct_ser.serialize_field("signer", &self.signer)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSubmitMisbehaviour { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["client_id", "clientId", "misbehaviour", "signer"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientId, - Misbehaviour, - Signer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "misbehaviour" => Ok(GeneratedField::Misbehaviour), - "signer" => Ok(GeneratedField::Signer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSubmitMisbehaviour; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.MsgSubmitMisbehaviour") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_id__ = None; - let mut misbehaviour__ = None; - let mut signer__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - GeneratedField::Misbehaviour => { - if misbehaviour__.is_some() { - return Err(serde::de::Error::duplicate_field("misbehaviour")); - } - misbehaviour__ = map.next_value()?; - } - GeneratedField::Signer => { - if signer__.is_some() { - return Err(serde::de::Error::duplicate_field("signer")); - } - signer__ = Some(map.next_value()?); - } - } - } - Ok(MsgSubmitMisbehaviour { - client_id: client_id__.unwrap_or_default(), - misbehaviour: misbehaviour__, - signer: signer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.MsgSubmitMisbehaviour", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgSubmitMisbehaviourResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = - serializer.serialize_struct("ibc.core.client.v1.MsgSubmitMisbehaviourResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgSubmitMisbehaviourResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgSubmitMisbehaviourResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.MsgSubmitMisbehaviourResponse") - } - - 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(MsgSubmitMisbehaviourResponse {}) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.MsgSubmitMisbehaviourResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgUpdateClient { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_id.is_empty() { - len += 1; - } - if self.client_message.is_some() { - len += 1; - } - if !self.signer.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.MsgUpdateClient", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - if let Some(v) = self.client_message.as_ref() { - struct_ser.serialize_field("clientMessage", v)?; - } - if !self.signer.is_empty() { - struct_ser.serialize_field("signer", &self.signer)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUpdateClient { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "client_id", - "clientId", - "client_message", - "clientMessage", - "signer", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientId, - ClientMessage, - Signer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "clientMessage" | "client_message" => Ok(GeneratedField::ClientMessage), - "signer" => Ok(GeneratedField::Signer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgUpdateClient; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.MsgUpdateClient") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_id__ = None; - let mut client_message__ = None; - let mut signer__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - GeneratedField::ClientMessage => { - if client_message__.is_some() { - return Err(serde::de::Error::duplicate_field("clientMessage")); - } - client_message__ = map.next_value()?; - } - GeneratedField::Signer => { - if signer__.is_some() { - return Err(serde::de::Error::duplicate_field("signer")); - } - signer__ = Some(map.next_value()?); - } - } - } - Ok(MsgUpdateClient { - client_id: client_id__.unwrap_or_default(), - client_message: client_message__, - signer: signer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.MsgUpdateClient", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgUpdateClientResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = - serializer.serialize_struct("ibc.core.client.v1.MsgUpdateClientResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUpdateClientResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgUpdateClientResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.MsgUpdateClientResponse") - } - - 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(MsgUpdateClientResponse {}) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.MsgUpdateClientResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgUpgradeClient { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_id.is_empty() { - len += 1; - } - if self.client_state.is_some() { - len += 1; - } - if self.consensus_state.is_some() { - len += 1; - } - if !self.proof_upgrade_client.is_empty() { - len += 1; - } - if !self.proof_upgrade_consensus_state.is_empty() { - len += 1; - } - if !self.signer.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.MsgUpgradeClient", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - if let Some(v) = self.client_state.as_ref() { - struct_ser.serialize_field("clientState", v)?; - } - if let Some(v) = self.consensus_state.as_ref() { - struct_ser.serialize_field("consensusState", v)?; - } - if !self.proof_upgrade_client.is_empty() { - struct_ser.serialize_field( - "proofUpgradeClient", - pbjson::private::base64::encode(&self.proof_upgrade_client).as_str(), - )?; - } - if !self.proof_upgrade_consensus_state.is_empty() { - struct_ser.serialize_field( - "proofUpgradeConsensusState", - pbjson::private::base64::encode(&self.proof_upgrade_consensus_state).as_str(), - )?; - } - if !self.signer.is_empty() { - struct_ser.serialize_field("signer", &self.signer)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUpgradeClient { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "client_id", - "clientId", - "client_state", - "clientState", - "consensus_state", - "consensusState", - "proof_upgrade_client", - "proofUpgradeClient", - "proof_upgrade_consensus_state", - "proofUpgradeConsensusState", - "signer", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientId, - ClientState, - ConsensusState, - ProofUpgradeClient, - ProofUpgradeConsensusState, - Signer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "clientState" | "client_state" => Ok(GeneratedField::ClientState), - "consensusState" | "consensus_state" => { - Ok(GeneratedField::ConsensusState) - } - "proofUpgradeClient" | "proof_upgrade_client" => { - Ok(GeneratedField::ProofUpgradeClient) - } - "proofUpgradeConsensusState" | "proof_upgrade_consensus_state" => { - Ok(GeneratedField::ProofUpgradeConsensusState) - } - "signer" => Ok(GeneratedField::Signer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgUpgradeClient; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.MsgUpgradeClient") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_id__ = None; - let mut client_state__ = None; - let mut consensus_state__ = None; - let mut proof_upgrade_client__ = None; - let mut proof_upgrade_consensus_state__ = None; - let mut signer__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - GeneratedField::ClientState => { - if client_state__.is_some() { - return Err(serde::de::Error::duplicate_field("clientState")); - } - client_state__ = map.next_value()?; - } - GeneratedField::ConsensusState => { - if consensus_state__.is_some() { - return Err(serde::de::Error::duplicate_field("consensusState")); - } - consensus_state__ = map.next_value()?; - } - GeneratedField::ProofUpgradeClient => { - if proof_upgrade_client__.is_some() { - return Err(serde::de::Error::duplicate_field( - "proofUpgradeClient", - )); - } - proof_upgrade_client__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofUpgradeConsensusState => { - if proof_upgrade_consensus_state__.is_some() { - return Err(serde::de::Error::duplicate_field( - "proofUpgradeConsensusState", - )); - } - proof_upgrade_consensus_state__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Signer => { - if signer__.is_some() { - return Err(serde::de::Error::duplicate_field("signer")); - } - signer__ = Some(map.next_value()?); - } - } - } - Ok(MsgUpgradeClient { - client_id: client_id__.unwrap_or_default(), - client_state: client_state__, - consensus_state: consensus_state__, - proof_upgrade_client: proof_upgrade_client__.unwrap_or_default(), - proof_upgrade_consensus_state: proof_upgrade_consensus_state__ - .unwrap_or_default(), - signer: signer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.MsgUpgradeClient", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgUpgradeClientResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = - serializer.serialize_struct("ibc.core.client.v1.MsgUpgradeClientResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgUpgradeClientResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgUpgradeClientResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.MsgUpgradeClientResponse") - } - - 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(MsgUpgradeClientResponse {}) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.MsgUpgradeClientResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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.allowed_clients.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("ibc.core.client.v1.Params", len)?; - if !self.allowed_clients.is_empty() { - struct_ser.serialize_field("allowedClients", &self.allowed_clients)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Params { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["allowed_clients", "allowedClients"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - AllowedClients, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "allowedClients" | "allowed_clients" => { - Ok(GeneratedField::AllowedClients) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Params; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.Params") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut allowed_clients__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::AllowedClients => { - if allowed_clients__.is_some() { - return Err(serde::de::Error::duplicate_field("allowedClients")); - } - allowed_clients__ = Some(map.next_value()?); - } - } - } - Ok(Params { - allowed_clients: allowed_clients__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("ibc.core.client.v1.Params", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryClientParamsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = - serializer.serialize_struct("ibc.core.client.v1.QueryClientParamsRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryClientParamsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = QueryClientParamsRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryClientParamsRequest") - } - - 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(QueryClientParamsRequest {}) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.QueryClientParamsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryClientParamsResponse { - #[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("ibc.core.client.v1.QueryClientParamsResponse", len)?; - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryClientParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["params"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = QueryClientParamsResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryClientParamsResponse") - } - - 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(QueryClientParamsResponse { params: params__ }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.QueryClientParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryClientStateRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_id.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.QueryClientStateRequest", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryClientStateRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["client_id", "clientId"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryClientStateRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryClientStateRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - } - } - Ok(QueryClientStateRequest { - client_id: client_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.QueryClientStateRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryClientStateResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.client_state.is_some() { - len += 1; - } - if !self.proof.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.QueryClientStateResponse", len)?; - if let Some(v) = self.client_state.as_ref() { - struct_ser.serialize_field("clientState", v)?; - } - if !self.proof.is_empty() { - struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryClientStateResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "client_state", - "clientState", - "proof", - "proof_height", - "proofHeight", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientState, - Proof, - ProofHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientState" | "client_state" => Ok(GeneratedField::ClientState), - "proof" => Ok(GeneratedField::Proof), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryClientStateResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryClientStateResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_state__ = None; - let mut proof__ = None; - let mut proof_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientState => { - if client_state__.is_some() { - return Err(serde::de::Error::duplicate_field("clientState")); - } - client_state__ = map.next_value()?; - } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); - } - proof__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - } - } - Ok(QueryClientStateResponse { - client_state: client_state__, - proof: proof__.unwrap_or_default(), - proof_height: proof_height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.QueryClientStateResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryClientStatesRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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("ibc.core.client.v1.QueryClientStatesRequest", len)?; - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryClientStatesRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["pagination"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = QueryClientStatesRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryClientStatesRequest") - } - - 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(QueryClientStatesRequest { - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.QueryClientStatesRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryClientStatesResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_states.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.QueryClientStatesResponse", len)?; - if !self.client_states.is_empty() { - struct_ser.serialize_field("clientStates", &self.client_states)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryClientStatesResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["client_states", "clientStates", "pagination"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientStates, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientStates" | "client_states" => Ok(GeneratedField::ClientStates), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryClientStatesResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryClientStatesResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_states__ = None; - let mut pagination__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientStates => { - if client_states__.is_some() { - return Err(serde::de::Error::duplicate_field("clientStates")); - } - client_states__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - } - } - Ok(QueryClientStatesResponse { - client_states: client_states__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.QueryClientStatesResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryClientStatusRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_id.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.QueryClientStatusRequest", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryClientStatusRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["client_id", "clientId"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryClientStatusRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryClientStatusRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - } - } - Ok(QueryClientStatusRequest { - client_id: client_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.QueryClientStatusRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryClientStatusResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.status.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.QueryClientStatusResponse", len)?; - if !self.status.is_empty() { - struct_ser.serialize_field("status", &self.status)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryClientStatusResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["status"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Status, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryClientStatusResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryClientStatusResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut status__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Status => { - if status__.is_some() { - return Err(serde::de::Error::duplicate_field("status")); - } - status__ = Some(map.next_value()?); - } - } - } - Ok(QueryClientStatusResponse { - status: status__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.QueryClientStatusResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryConsensusStateHeightsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_id.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.client.v1.QueryConsensusStateHeightsRequest", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryConsensusStateHeightsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["client_id", "clientId", "pagination"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientId, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryConsensusStateHeightsRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryConsensusStateHeightsRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_id__ = None; - let mut pagination__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - } - } - Ok(QueryConsensusStateHeightsRequest { - client_id: client_id__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.QueryConsensusStateHeightsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryConsensusStateHeightsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.consensus_state_heights.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.client.v1.QueryConsensusStateHeightsResponse", len)?; - if !self.consensus_state_heights.is_empty() { - struct_ser.serialize_field("consensusStateHeights", &self.consensus_state_heights)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryConsensusStateHeightsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "consensus_state_heights", - "consensusStateHeights", - "pagination", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ConsensusStateHeights, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "consensusStateHeights" | "consensus_state_heights" => { - Ok(GeneratedField::ConsensusStateHeights) - } - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryConsensusStateHeightsResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryConsensusStateHeightsResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut consensus_state_heights__ = None; - let mut pagination__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ConsensusStateHeights => { - if consensus_state_heights__.is_some() { - return Err(serde::de::Error::duplicate_field( - "consensusStateHeights", - )); - } - consensus_state_heights__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - } - } - Ok(QueryConsensusStateHeightsResponse { - consensus_state_heights: consensus_state_heights__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.QueryConsensusStateHeightsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryConsensusStateRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_id.is_empty() { - len += 1; - } - if self.revision_number != 0 { - len += 1; - } - if self.revision_height != 0 { - len += 1; - } - if self.latest_height { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.QueryConsensusStateRequest", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - if self.revision_number != 0 { - struct_ser.serialize_field( - "revisionNumber", - ToString::to_string(&self.revision_number).as_str(), - )?; - } - if self.revision_height != 0 { - struct_ser.serialize_field( - "revisionHeight", - ToString::to_string(&self.revision_height).as_str(), - )?; - } - if self.latest_height { - struct_ser.serialize_field("latestHeight", &self.latest_height)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryConsensusStateRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "client_id", - "clientId", - "revision_number", - "revisionNumber", - "revision_height", - "revisionHeight", - "latest_height", - "latestHeight", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientId, - RevisionNumber, - RevisionHeight, - LatestHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "revisionNumber" | "revision_number" => { - Ok(GeneratedField::RevisionNumber) - } - "revisionHeight" | "revision_height" => { - Ok(GeneratedField::RevisionHeight) - } - "latestHeight" | "latest_height" => Ok(GeneratedField::LatestHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryConsensusStateRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryConsensusStateRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_id__ = None; - let mut revision_number__ = None; - let mut revision_height__ = None; - let mut latest_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - GeneratedField::RevisionNumber => { - if revision_number__.is_some() { - return Err(serde::de::Error::duplicate_field("revisionNumber")); - } - revision_number__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::RevisionHeight => { - if revision_height__.is_some() { - return Err(serde::de::Error::duplicate_field("revisionHeight")); - } - revision_height__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::LatestHeight => { - if latest_height__.is_some() { - return Err(serde::de::Error::duplicate_field("latestHeight")); - } - latest_height__ = Some(map.next_value()?); - } - } - } - Ok(QueryConsensusStateRequest { - client_id: client_id__.unwrap_or_default(), - revision_number: revision_number__.unwrap_or_default(), - revision_height: revision_height__.unwrap_or_default(), - latest_height: latest_height__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.QueryConsensusStateRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryConsensusStateResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.consensus_state.is_some() { - len += 1; - } - if !self.proof.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.QueryConsensusStateResponse", len)?; - if let Some(v) = self.consensus_state.as_ref() { - struct_ser.serialize_field("consensusState", v)?; - } - if !self.proof.is_empty() { - struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryConsensusStateResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "consensus_state", - "consensusState", - "proof", - "proof_height", - "proofHeight", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ConsensusState, - Proof, - ProofHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "consensusState" | "consensus_state" => { - Ok(GeneratedField::ConsensusState) - } - "proof" => Ok(GeneratedField::Proof), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryConsensusStateResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryConsensusStateResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut consensus_state__ = None; - let mut proof__ = None; - let mut proof_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ConsensusState => { - if consensus_state__.is_some() { - return Err(serde::de::Error::duplicate_field("consensusState")); - } - consensus_state__ = map.next_value()?; - } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); - } - proof__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - } - } - Ok(QueryConsensusStateResponse { - consensus_state: consensus_state__, - proof: proof__.unwrap_or_default(), - proof_height: proof_height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.QueryConsensusStateResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryConsensusStatesRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_id.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.QueryConsensusStatesRequest", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryConsensusStatesRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["client_id", "clientId", "pagination"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientId, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryConsensusStatesRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryConsensusStatesRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_id__ = None; - let mut pagination__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - } - } - Ok(QueryConsensusStatesRequest { - client_id: client_id__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.QueryConsensusStatesRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryConsensusStatesResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.consensus_states.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.QueryConsensusStatesResponse", len)?; - if !self.consensus_states.is_empty() { - struct_ser.serialize_field("consensusStates", &self.consensus_states)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryConsensusStatesResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["consensus_states", "consensusStates", "pagination"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ConsensusStates, - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "consensusStates" | "consensus_states" => { - Ok(GeneratedField::ConsensusStates) - } - "pagination" => Ok(GeneratedField::Pagination), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryConsensusStatesResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryConsensusStatesResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut consensus_states__ = None; - let mut pagination__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ConsensusStates => { - if consensus_states__.is_some() { - return Err(serde::de::Error::duplicate_field("consensusStates")); - } - consensus_states__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - } - } - Ok(QueryConsensusStatesResponse { - consensus_states: consensus_states__.unwrap_or_default(), - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.QueryConsensusStatesResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryUpgradedClientStateRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer - .serialize_struct("ibc.core.client.v1.QueryUpgradedClientStateRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryUpgradedClientStateRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = QueryUpgradedClientStateRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryUpgradedClientStateRequest") - } - - 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(QueryUpgradedClientStateRequest {}) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.QueryUpgradedClientStateRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryUpgradedClientStateResponse { - #[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_client_state.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.client.v1.QueryUpgradedClientStateResponse", len)?; - if let Some(v) = self.upgraded_client_state.as_ref() { - struct_ser.serialize_field("upgradedClientState", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryUpgradedClientStateResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["upgraded_client_state", "upgradedClientState"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - UpgradedClientState, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "upgradedClientState" | "upgraded_client_state" => { - Ok(GeneratedField::UpgradedClientState) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryUpgradedClientStateResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryUpgradedClientStateResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut upgraded_client_state__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::UpgradedClientState => { - if upgraded_client_state__.is_some() { - return Err(serde::de::Error::duplicate_field( - "upgradedClientState", - )); - } - upgraded_client_state__ = map.next_value()?; - } - } - } - Ok(QueryUpgradedClientStateResponse { - upgraded_client_state: upgraded_client_state__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.QueryUpgradedClientStateResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryUpgradedConsensusStateRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer - .serialize_struct("ibc.core.client.v1.QueryUpgradedConsensusStateRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryUpgradedConsensusStateRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = QueryUpgradedConsensusStateRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryUpgradedConsensusStateRequest") - } - - 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(QueryUpgradedConsensusStateRequest {}) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.QueryUpgradedConsensusStateRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -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_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.core.client.v1.QueryUpgradedConsensusStateResponse", - len, - )?; - if let Some(v) = self.upgraded_consensus_state.as_ref() { - struct_ser.serialize_field("upgradedConsensusState", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryUpgradedConsensusStateResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["upgraded_consensus_state", "upgradedConsensusState"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - UpgradedConsensusState, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 ibc.core.client.v1.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__ = map.next_value()?; - } - } - } - Ok(QueryUpgradedConsensusStateResponse { - upgraded_consensus_state: upgraded_consensus_state__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.QueryUpgradedConsensusStateResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for UpgradeProposal { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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; - } - if self.upgraded_client_state.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.UpgradeProposal", 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)?; - } - if let Some(v) = self.upgraded_client_state.as_ref() { - struct_ser.serialize_field("upgradedClientState", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for UpgradeProposal { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "title", - "description", - "plan", - "upgraded_client_state", - "upgradedClientState", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Title, - Description, - Plan, - UpgradedClientState, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "upgradedClientState" | "upgraded_client_state" => { - Ok(GeneratedField::UpgradedClientState) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = UpgradeProposal; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.UpgradeProposal") - } - - 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; - let mut upgraded_client_state__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Title => { - if title__.is_some() { - return Err(serde::de::Error::duplicate_field("title")); - } - title__ = Some(map.next_value()?); - } - GeneratedField::Description => { - if description__.is_some() { - return Err(serde::de::Error::duplicate_field("description")); - } - description__ = Some(map.next_value()?); - } - GeneratedField::Plan => { - if plan__.is_some() { - return Err(serde::de::Error::duplicate_field("plan")); - } - plan__ = map.next_value()?; - } - GeneratedField::UpgradedClientState => { - if upgraded_client_state__.is_some() { - return Err(serde::de::Error::duplicate_field( - "upgradedClientState", - )); - } - upgraded_client_state__ = map.next_value()?; - } - } - } - Ok(UpgradeProposal { - title: title__.unwrap_or_default(), - description: description__.unwrap_or_default(), - plan: plan__, - upgraded_client_state: upgraded_client_state__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.client.v1.UpgradeProposal", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/ibc.core.commitment.v1.rs b/packages/proto/src/gen/ibc.core.commitment.v1.rs index 7b9f31f..ad02404 100644 --- a/packages/proto/src/gen/ibc.core.commitment.v1.rs +++ b/packages/proto/src/gen/ibc.core.commitment.v1.rs @@ -1,6 +1,7 @@ // @generated /// MerkleRoot defines a merkle root hash. /// In the Cosmos SDK, the AppHash of a block header becomes the root. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MerkleRoot { @@ -17,6 +18,7 @@ impl ::prost::Name for MerkleRoot { /// MerklePrefix is merkle path prefixed to the key. /// The constructed key from the Path and the key will be append(Path.KeyPath, /// append(Path.KeyPrefix, key...)) +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MerklePrefix { @@ -33,6 +35,7 @@ impl ::prost::Name for MerklePrefix { /// MerklePath is the path used to verify commitment proofs, which can be an /// arbitrary structured object (defined by a commitment type). /// MerklePath is represented from root-to-leaf +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MerklePath { @@ -51,6 +54,7 @@ impl ::prost::Name for MerklePath { /// elements, verifiable in conjunction with a known commitment root. Proofs /// should be succinct. /// MerkleProofs are ordered from leaf-to-root +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MerkleProof { @@ -178,5 +182,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x03, 0x02, 0x00, 0x03, 0x12, 0x03, 0x27, 0x34, 0x35, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("ibc.core.commitment.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/ibc.core.commitment.v1.serde.rs b/packages/proto/src/gen/ibc.core.commitment.v1.serde.rs deleted file mode 100644 index 646341c..0000000 --- a/packages/proto/src/gen/ibc.core.commitment.v1.serde.rs +++ /dev/null @@ -1,399 +0,0 @@ -// @generated -impl serde::Serialize for MerklePath { - #[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_path.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.commitment.v1.MerklePath", len)?; - if !self.key_path.is_empty() { - struct_ser.serialize_field("keyPath", &self.key_path)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MerklePath { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["key_path", "keyPath"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - KeyPath, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "keyPath" | "key_path" => Ok(GeneratedField::KeyPath), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MerklePath; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.commitment.v1.MerklePath") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key_path__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::KeyPath => { - if key_path__.is_some() { - return Err(serde::de::Error::duplicate_field("keyPath")); - } - key_path__ = Some(map.next_value()?); - } - } - } - Ok(MerklePath { - key_path: key_path__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.commitment.v1.MerklePath", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MerklePrefix { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.key_prefix.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.commitment.v1.MerklePrefix", len)?; - if !self.key_prefix.is_empty() { - struct_ser.serialize_field( - "keyPrefix", - pbjson::private::base64::encode(&self.key_prefix).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MerklePrefix { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["key_prefix", "keyPrefix"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - KeyPrefix, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "keyPrefix" | "key_prefix" => Ok(GeneratedField::KeyPrefix), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MerklePrefix; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.commitment.v1.MerklePrefix") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key_prefix__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::KeyPrefix => { - if key_prefix__.is_some() { - return Err(serde::de::Error::duplicate_field("keyPrefix")); - } - key_prefix__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - } - } - Ok(MerklePrefix { - key_prefix: key_prefix__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.commitment.v1.MerklePrefix", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MerkleProof { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.proofs.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.commitment.v1.MerkleProof", len)?; - if !self.proofs.is_empty() { - struct_ser.serialize_field("proofs", &self.proofs)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MerkleProof { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["proofs"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Proofs, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "proofs" => Ok(GeneratedField::Proofs), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MerkleProof; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.commitment.v1.MerkleProof") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut proofs__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Proofs => { - if proofs__.is_some() { - return Err(serde::de::Error::duplicate_field("proofs")); - } - proofs__ = Some(map.next_value()?); - } - } - } - Ok(MerkleProof { - proofs: proofs__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.commitment.v1.MerkleProof", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MerkleRoot { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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("ibc.core.commitment.v1.MerkleRoot", len)?; - if !self.hash.is_empty() { - struct_ser - .serialize_field("hash", pbjson::private::base64::encode(&self.hash).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MerkleRoot { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["hash"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Hash, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = MerkleRoot; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.commitment.v1.MerkleRoot") - } - - 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(MerkleRoot { - hash: hash__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.commitment.v1.MerkleRoot", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/ibc.core.connection.v1.rs b/packages/proto/src/gen/ibc.core.connection.v1.rs index 250a8cc..ae6f30f 100644 --- a/packages/proto/src/gen/ibc.core.connection.v1.rs +++ b/packages/proto/src/gen/ibc.core.connection.v1.rs @@ -6,6 +6,7 @@ /// separate one. /// NOTE: there must only be 2 defined ConnectionEnds to establish /// a connection between two chains. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConnectionEnd { @@ -37,6 +38,7 @@ impl ::prost::Name for ConnectionEnd { } /// IdentifiedConnection defines a connection with additional connection /// identifier field. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IdentifiedConnection { @@ -68,6 +70,7 @@ impl ::prost::Name for IdentifiedConnection { } } /// Counterparty defines the counterparty chain associated with a connection end. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Counterparty { @@ -91,6 +94,7 @@ impl ::prost::Name for Counterparty { } } /// ClientPaths define all the connection paths for a client state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientPaths { @@ -106,6 +110,7 @@ impl ::prost::Name for ClientPaths { } } /// ConnectionPaths define all the connection paths for a given client state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConnectionPaths { @@ -125,6 +130,7 @@ impl ::prost::Name for ConnectionPaths { } /// Version defines the versioning scheme used to negotiate the IBC verison in /// the connection handshake. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Version { @@ -143,6 +149,7 @@ impl ::prost::Name for Version { } } /// Params defines the set of Connection parameters. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -161,7 +168,19 @@ impl ::prost::Name for Params { } /// State defines if a connection is in one of the following states: /// INIT, TRYOPEN, OPEN or UNINITIALIZED. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum State { /// Default State @@ -199,6 +218,7 @@ impl State { } } /// GenesisState defines the ibc connection submodule's genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -221,6 +241,7 @@ impl ::prost::Name for GenesisState { } /// QueryConnectionRequest is the request type for the Query/Connection RPC /// method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionRequest { @@ -238,6 +259,7 @@ impl ::prost::Name for QueryConnectionRequest { /// QueryConnectionResponse is the response type for the Query/Connection RPC /// method. Besides the connection end, it includes a proof and the height from /// which the proof was retrieved. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionResponse { @@ -260,6 +282,7 @@ impl ::prost::Name for QueryConnectionResponse { } /// QueryConnectionsRequest is the request type for the Query/Connections RPC /// method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionsRequest { @@ -277,6 +300,7 @@ impl ::prost::Name for QueryConnectionsRequest { } /// QueryConnectionsResponse is the response type for the Query/Connections RPC /// method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionsResponse { @@ -301,6 +325,7 @@ impl ::prost::Name for QueryConnectionsResponse { } /// QueryClientConnectionsRequest is the request type for the /// Query/ClientConnections RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientConnectionsRequest { @@ -317,6 +342,7 @@ impl ::prost::Name for QueryClientConnectionsRequest { } /// QueryClientConnectionsResponse is the response type for the /// Query/ClientConnections RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientConnectionsResponse { @@ -339,6 +365,7 @@ impl ::prost::Name for QueryClientConnectionsResponse { } /// QueryConnectionClientStateRequest is the request type for the /// Query/ConnectionClientState RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionClientStateRequest { @@ -355,6 +382,7 @@ impl ::prost::Name for QueryConnectionClientStateRequest { } /// QueryConnectionClientStateResponse is the response type for the /// Query/ConnectionClientState RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionClientStateResponse { @@ -378,6 +406,7 @@ impl ::prost::Name for QueryConnectionClientStateResponse { } /// QueryConnectionConsensusStateRequest is the request type for the /// Query/ConnectionConsensusState RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionConsensusStateRequest { @@ -398,6 +427,7 @@ impl ::prost::Name for QueryConnectionConsensusStateRequest { } /// QueryConnectionConsensusStateResponse is the response type for the /// Query/ConnectionConsensusState RPC method +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionConsensusStateResponse { @@ -422,6 +452,7 @@ impl ::prost::Name for QueryConnectionConsensusStateResponse { } } /// QueryConnectionParamsRequest is the request type for the Query/ConnectionParams RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionParamsRequest {} @@ -433,6 +464,7 @@ impl ::prost::Name for QueryConnectionParamsRequest { } } /// QueryConnectionParamsResponse is the response type for the Query/ConnectionParams RPC method. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionParamsResponse { @@ -449,6 +481,7 @@ impl ::prost::Name for QueryConnectionParamsResponse { } /// MsgConnectionOpenInit defines the msg sent by an account on Chain A to /// initialize a connection with Chain B. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenInit { @@ -472,6 +505,7 @@ impl ::prost::Name for MsgConnectionOpenInit { } /// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response /// type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenInitResponse {} @@ -484,6 +518,7 @@ impl ::prost::Name for MsgConnectionOpenInitResponse { } /// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a /// connection on Chain B. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenTry { @@ -529,6 +564,7 @@ impl ::prost::Name for MsgConnectionOpenTry { } } /// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenTryResponse {} @@ -541,6 +577,7 @@ impl ::prost::Name for MsgConnectionOpenTryResponse { } /// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to /// acknowledge the change of connection state to TRYOPEN on Chain B. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenAck { @@ -580,6 +617,7 @@ impl ::prost::Name for MsgConnectionOpenAck { } } /// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenAckResponse {} @@ -592,6 +630,7 @@ impl ::prost::Name for MsgConnectionOpenAckResponse { } /// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to /// acknowledge the change of connection state to OPEN on Chain A. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenConfirm { @@ -614,6 +653,7 @@ impl ::prost::Name for MsgConnectionOpenConfirm { } /// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm /// response type. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenConfirmResponse {} @@ -2166,6 +2206,5 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x70, 0x65, 0x2e, 0x0a, 0x0a, 0x0a, 0x0a, 0x03, 0x04, 0x07, 0x01, 0x12, 0x03, 0x79, 0x08, 0x28, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("ibc.core.connection.v1.serde.rs"); include!("ibc.core.connection.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/ibc.core.connection.v1.serde.rs b/packages/proto/src/gen/ibc.core.connection.v1.serde.rs deleted file mode 100644 index df14ec3..0000000 --- a/packages/proto/src/gen/ibc.core.connection.v1.serde.rs +++ /dev/null @@ -1,3981 +0,0 @@ -// @generated -impl serde::Serialize for ClientPaths { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.paths.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.connection.v1.ClientPaths", len)?; - if !self.paths.is_empty() { - struct_ser.serialize_field("paths", &self.paths)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ClientPaths { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["paths"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Paths, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "paths" => Ok(GeneratedField::Paths), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ClientPaths; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.ClientPaths") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut paths__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Paths => { - if paths__.is_some() { - return Err(serde::de::Error::duplicate_field("paths")); - } - paths__ = Some(map.next_value()?); - } - } - } - Ok(ClientPaths { - paths: paths__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.ClientPaths", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ConnectionEnd { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_id.is_empty() { - len += 1; - } - if !self.versions.is_empty() { - len += 1; - } - if self.state != 0 { - len += 1; - } - if self.counterparty.is_some() { - len += 1; - } - if self.delay_period != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.connection.v1.ConnectionEnd", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - if !self.versions.is_empty() { - struct_ser.serialize_field("versions", &self.versions)?; - } - if self.state != 0 { - let v = State::from_i32(self.state).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.state)) - })?; - struct_ser.serialize_field("state", &v)?; - } - if let Some(v) = self.counterparty.as_ref() { - struct_ser.serialize_field("counterparty", v)?; - } - if self.delay_period != 0 { - struct_ser.serialize_field( - "delayPeriod", - ToString::to_string(&self.delay_period).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ConnectionEnd { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "client_id", - "clientId", - "versions", - "state", - "counterparty", - "delay_period", - "delayPeriod", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientId, - Versions, - State, - Counterparty, - DelayPeriod, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "versions" => Ok(GeneratedField::Versions), - "state" => Ok(GeneratedField::State), - "counterparty" => Ok(GeneratedField::Counterparty), - "delayPeriod" | "delay_period" => Ok(GeneratedField::DelayPeriod), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ConnectionEnd; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.ConnectionEnd") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_id__ = None; - let mut versions__ = None; - let mut state__ = None; - let mut counterparty__ = None; - let mut delay_period__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - GeneratedField::Versions => { - if versions__.is_some() { - return Err(serde::de::Error::duplicate_field("versions")); - } - versions__ = Some(map.next_value()?); - } - GeneratedField::State => { - if state__.is_some() { - return Err(serde::de::Error::duplicate_field("state")); - } - state__ = Some(map.next_value::()? as i32); - } - GeneratedField::Counterparty => { - if counterparty__.is_some() { - return Err(serde::de::Error::duplicate_field("counterparty")); - } - counterparty__ = map.next_value()?; - } - GeneratedField::DelayPeriod => { - if delay_period__.is_some() { - return Err(serde::de::Error::duplicate_field("delayPeriod")); - } - delay_period__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(ConnectionEnd { - client_id: client_id__.unwrap_or_default(), - versions: versions__.unwrap_or_default(), - state: state__.unwrap_or_default(), - counterparty: counterparty__, - delay_period: delay_period__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.ConnectionEnd", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ConnectionPaths { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_id.is_empty() { - len += 1; - } - if !self.paths.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.connection.v1.ConnectionPaths", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - if !self.paths.is_empty() { - struct_ser.serialize_field("paths", &self.paths)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ConnectionPaths { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["client_id", "clientId", "paths"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientId, - Paths, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "paths" => Ok(GeneratedField::Paths), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ConnectionPaths; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.ConnectionPaths") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_id__ = None; - let mut paths__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - GeneratedField::Paths => { - if paths__.is_some() { - return Err(serde::de::Error::duplicate_field("paths")); - } - paths__ = Some(map.next_value()?); - } - } - } - Ok(ConnectionPaths { - client_id: client_id__.unwrap_or_default(), - paths: paths__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.ConnectionPaths", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for Counterparty { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_id.is_empty() { - len += 1; - } - if !self.connection_id.is_empty() { - len += 1; - } - if self.prefix.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.connection.v1.Counterparty", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - if !self.connection_id.is_empty() { - struct_ser.serialize_field("connectionId", &self.connection_id)?; - } - if let Some(v) = self.prefix.as_ref() { - struct_ser.serialize_field("prefix", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Counterparty { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "client_id", - "clientId", - "connection_id", - "connectionId", - "prefix", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientId, - ConnectionId, - Prefix, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), - "prefix" => Ok(GeneratedField::Prefix), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Counterparty; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.Counterparty") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_id__ = None; - let mut connection_id__ = None; - let mut prefix__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - GeneratedField::ConnectionId => { - if connection_id__.is_some() { - return Err(serde::de::Error::duplicate_field("connectionId")); - } - connection_id__ = Some(map.next_value()?); - } - GeneratedField::Prefix => { - if prefix__.is_some() { - return Err(serde::de::Error::duplicate_field("prefix")); - } - prefix__ = map.next_value()?; - } - } - } - Ok(Counterparty { - client_id: client_id__.unwrap_or_default(), - connection_id: connection_id__.unwrap_or_default(), - prefix: prefix__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.Counterparty", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for GenesisState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.connections.is_empty() { - len += 1; - } - if !self.client_connection_paths.is_empty() { - len += 1; - } - if self.next_connection_sequence != 0 { - len += 1; - } - if self.params.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.connection.v1.GenesisState", len)?; - if !self.connections.is_empty() { - struct_ser.serialize_field("connections", &self.connections)?; - } - if !self.client_connection_paths.is_empty() { - struct_ser.serialize_field("clientConnectionPaths", &self.client_connection_paths)?; - } - if self.next_connection_sequence != 0 { - struct_ser.serialize_field( - "nextConnectionSequence", - ToString::to_string(&self.next_connection_sequence).as_str(), - )?; - } - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GenesisState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "connections", - "client_connection_paths", - "clientConnectionPaths", - "next_connection_sequence", - "nextConnectionSequence", - "params", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Connections, - ClientConnectionPaths, - NextConnectionSequence, - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "connections" => Ok(GeneratedField::Connections), - "clientConnectionPaths" | "client_connection_paths" => { - Ok(GeneratedField::ClientConnectionPaths) - } - "nextConnectionSequence" | "next_connection_sequence" => { - Ok(GeneratedField::NextConnectionSequence) - } - "params" => Ok(GeneratedField::Params), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GenesisState; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.GenesisState") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut connections__ = None; - let mut client_connection_paths__ = None; - let mut next_connection_sequence__ = None; - let mut params__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Connections => { - if connections__.is_some() { - return Err(serde::de::Error::duplicate_field("connections")); - } - connections__ = Some(map.next_value()?); - } - GeneratedField::ClientConnectionPaths => { - if client_connection_paths__.is_some() { - return Err(serde::de::Error::duplicate_field( - "clientConnectionPaths", - )); - } - client_connection_paths__ = Some(map.next_value()?); - } - GeneratedField::NextConnectionSequence => { - if next_connection_sequence__.is_some() { - return Err(serde::de::Error::duplicate_field( - "nextConnectionSequence", - )); - } - next_connection_sequence__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Params => { - if params__.is_some() { - return Err(serde::de::Error::duplicate_field("params")); - } - params__ = map.next_value()?; - } - } - } - Ok(GenesisState { - connections: connections__.unwrap_or_default(), - client_connection_paths: client_connection_paths__.unwrap_or_default(), - next_connection_sequence: next_connection_sequence__.unwrap_or_default(), - params: params__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.GenesisState", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for IdentifiedConnection { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.id.is_empty() { - len += 1; - } - if !self.client_id.is_empty() { - len += 1; - } - if !self.versions.is_empty() { - len += 1; - } - if self.state != 0 { - len += 1; - } - if self.counterparty.is_some() { - len += 1; - } - if self.delay_period != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.connection.v1.IdentifiedConnection", len)?; - if !self.id.is_empty() { - struct_ser.serialize_field("id", &self.id)?; - } - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - if !self.versions.is_empty() { - struct_ser.serialize_field("versions", &self.versions)?; - } - if self.state != 0 { - let v = State::from_i32(self.state).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.state)) - })?; - struct_ser.serialize_field("state", &v)?; - } - if let Some(v) = self.counterparty.as_ref() { - struct_ser.serialize_field("counterparty", v)?; - } - if self.delay_period != 0 { - struct_ser.serialize_field( - "delayPeriod", - ToString::to_string(&self.delay_period).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for IdentifiedConnection { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "id", - "client_id", - "clientId", - "versions", - "state", - "counterparty", - "delay_period", - "delayPeriod", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Id, - ClientId, - Versions, - State, - Counterparty, - DelayPeriod, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "versions" => Ok(GeneratedField::Versions), - "state" => Ok(GeneratedField::State), - "counterparty" => Ok(GeneratedField::Counterparty), - "delayPeriod" | "delay_period" => Ok(GeneratedField::DelayPeriod), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IdentifiedConnection; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.IdentifiedConnection") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut id__ = None; - let mut client_id__ = None; - let mut versions__ = None; - let mut state__ = None; - let mut counterparty__ = None; - let mut delay_period__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Id => { - if id__.is_some() { - return Err(serde::de::Error::duplicate_field("id")); - } - id__ = Some(map.next_value()?); - } - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - GeneratedField::Versions => { - if versions__.is_some() { - return Err(serde::de::Error::duplicate_field("versions")); - } - versions__ = Some(map.next_value()?); - } - GeneratedField::State => { - if state__.is_some() { - return Err(serde::de::Error::duplicate_field("state")); - } - state__ = Some(map.next_value::()? as i32); - } - GeneratedField::Counterparty => { - if counterparty__.is_some() { - return Err(serde::de::Error::duplicate_field("counterparty")); - } - counterparty__ = map.next_value()?; - } - GeneratedField::DelayPeriod => { - if delay_period__.is_some() { - return Err(serde::de::Error::duplicate_field("delayPeriod")); - } - delay_period__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(IdentifiedConnection { - id: id__.unwrap_or_default(), - client_id: client_id__.unwrap_or_default(), - versions: versions__.unwrap_or_default(), - state: state__.unwrap_or_default(), - counterparty: counterparty__, - delay_period: delay_period__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.IdentifiedConnection", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgConnectionOpenAck { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.connection_id.is_empty() { - len += 1; - } - if !self.counterparty_connection_id.is_empty() { - len += 1; - } - if self.version.is_some() { - len += 1; - } - if self.client_state.is_some() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - if !self.proof_try.is_empty() { - len += 1; - } - if !self.proof_client.is_empty() { - len += 1; - } - if !self.proof_consensus.is_empty() { - len += 1; - } - if self.consensus_height.is_some() { - len += 1; - } - if !self.signer.is_empty() { - len += 1; - } - if !self.host_consensus_state_proof.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.connection.v1.MsgConnectionOpenAck", len)?; - if !self.connection_id.is_empty() { - struct_ser.serialize_field("connectionId", &self.connection_id)?; - } - if !self.counterparty_connection_id.is_empty() { - struct_ser - .serialize_field("counterpartyConnectionId", &self.counterparty_connection_id)?; - } - if let Some(v) = self.version.as_ref() { - struct_ser.serialize_field("version", v)?; - } - if let Some(v) = self.client_state.as_ref() { - struct_ser.serialize_field("clientState", v)?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - if !self.proof_try.is_empty() { - struct_ser.serialize_field( - "proofTry", - pbjson::private::base64::encode(&self.proof_try).as_str(), - )?; - } - if !self.proof_client.is_empty() { - struct_ser.serialize_field( - "proofClient", - pbjson::private::base64::encode(&self.proof_client).as_str(), - )?; - } - if !self.proof_consensus.is_empty() { - struct_ser.serialize_field( - "proofConsensus", - pbjson::private::base64::encode(&self.proof_consensus).as_str(), - )?; - } - if let Some(v) = self.consensus_height.as_ref() { - struct_ser.serialize_field("consensusHeight", v)?; - } - if !self.signer.is_empty() { - struct_ser.serialize_field("signer", &self.signer)?; - } - if !self.host_consensus_state_proof.is_empty() { - struct_ser.serialize_field( - "hostConsensusStateProof", - pbjson::private::base64::encode(&self.host_consensus_state_proof).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgConnectionOpenAck { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "connection_id", - "connectionId", - "counterparty_connection_id", - "counterpartyConnectionId", - "version", - "client_state", - "clientState", - "proof_height", - "proofHeight", - "proof_try", - "proofTry", - "proof_client", - "proofClient", - "proof_consensus", - "proofConsensus", - "consensus_height", - "consensusHeight", - "signer", - "host_consensus_state_proof", - "hostConsensusStateProof", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ConnectionId, - CounterpartyConnectionId, - Version, - ClientState, - ProofHeight, - ProofTry, - ProofClient, - ProofConsensus, - ConsensusHeight, - Signer, - HostConsensusStateProof, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), - "counterpartyConnectionId" | "counterparty_connection_id" => { - Ok(GeneratedField::CounterpartyConnectionId) - } - "version" => Ok(GeneratedField::Version), - "clientState" | "client_state" => Ok(GeneratedField::ClientState), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - "proofTry" | "proof_try" => Ok(GeneratedField::ProofTry), - "proofClient" | "proof_client" => Ok(GeneratedField::ProofClient), - "proofConsensus" | "proof_consensus" => { - Ok(GeneratedField::ProofConsensus) - } - "consensusHeight" | "consensus_height" => { - Ok(GeneratedField::ConsensusHeight) - } - "signer" => Ok(GeneratedField::Signer), - "hostConsensusStateProof" | "host_consensus_state_proof" => { - Ok(GeneratedField::HostConsensusStateProof) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgConnectionOpenAck; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.MsgConnectionOpenAck") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut connection_id__ = None; - let mut counterparty_connection_id__ = None; - let mut version__ = None; - let mut client_state__ = None; - let mut proof_height__ = None; - let mut proof_try__ = None; - let mut proof_client__ = None; - let mut proof_consensus__ = None; - let mut consensus_height__ = None; - let mut signer__ = None; - let mut host_consensus_state_proof__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ConnectionId => { - if connection_id__.is_some() { - return Err(serde::de::Error::duplicate_field("connectionId")); - } - connection_id__ = Some(map.next_value()?); - } - GeneratedField::CounterpartyConnectionId => { - if counterparty_connection_id__.is_some() { - return Err(serde::de::Error::duplicate_field( - "counterpartyConnectionId", - )); - } - counterparty_connection_id__ = Some(map.next_value()?); - } - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); - } - version__ = map.next_value()?; - } - GeneratedField::ClientState => { - if client_state__.is_some() { - return Err(serde::de::Error::duplicate_field("clientState")); - } - client_state__ = map.next_value()?; - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - GeneratedField::ProofTry => { - if proof_try__.is_some() { - return Err(serde::de::Error::duplicate_field("proofTry")); - } - proof_try__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofClient => { - if proof_client__.is_some() { - return Err(serde::de::Error::duplicate_field("proofClient")); - } - proof_client__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofConsensus => { - if proof_consensus__.is_some() { - return Err(serde::de::Error::duplicate_field("proofConsensus")); - } - proof_consensus__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ConsensusHeight => { - if consensus_height__.is_some() { - return Err(serde::de::Error::duplicate_field("consensusHeight")); - } - consensus_height__ = map.next_value()?; - } - GeneratedField::Signer => { - if signer__.is_some() { - return Err(serde::de::Error::duplicate_field("signer")); - } - signer__ = Some(map.next_value()?); - } - GeneratedField::HostConsensusStateProof => { - if host_consensus_state_proof__.is_some() { - return Err(serde::de::Error::duplicate_field( - "hostConsensusStateProof", - )); - } - host_consensus_state_proof__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - } - } - Ok(MsgConnectionOpenAck { - connection_id: connection_id__.unwrap_or_default(), - counterparty_connection_id: counterparty_connection_id__.unwrap_or_default(), - version: version__, - client_state: client_state__, - proof_height: proof_height__, - proof_try: proof_try__.unwrap_or_default(), - proof_client: proof_client__.unwrap_or_default(), - proof_consensus: proof_consensus__.unwrap_or_default(), - consensus_height: consensus_height__, - signer: signer__.unwrap_or_default(), - host_consensus_state_proof: host_consensus_state_proof__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.MsgConnectionOpenAck", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgConnectionOpenAckResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer - .serialize_struct("ibc.core.connection.v1.MsgConnectionOpenAckResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgConnectionOpenAckResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgConnectionOpenAckResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.MsgConnectionOpenAckResponse") - } - - 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(MsgConnectionOpenAckResponse {}) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.MsgConnectionOpenAckResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgConnectionOpenConfirm { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.connection_id.is_empty() { - len += 1; - } - if !self.proof_ack.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - if !self.signer.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.connection.v1.MsgConnectionOpenConfirm", len)?; - if !self.connection_id.is_empty() { - struct_ser.serialize_field("connectionId", &self.connection_id)?; - } - if !self.proof_ack.is_empty() { - struct_ser.serialize_field( - "proofAck", - pbjson::private::base64::encode(&self.proof_ack).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - if !self.signer.is_empty() { - struct_ser.serialize_field("signer", &self.signer)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgConnectionOpenConfirm { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "connection_id", - "connectionId", - "proof_ack", - "proofAck", - "proof_height", - "proofHeight", - "signer", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ConnectionId, - ProofAck, - ProofHeight, - Signer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), - "proofAck" | "proof_ack" => Ok(GeneratedField::ProofAck), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - "signer" => Ok(GeneratedField::Signer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgConnectionOpenConfirm; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.MsgConnectionOpenConfirm") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut connection_id__ = None; - let mut proof_ack__ = None; - let mut proof_height__ = None; - let mut signer__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ConnectionId => { - if connection_id__.is_some() { - return Err(serde::de::Error::duplicate_field("connectionId")); - } - connection_id__ = Some(map.next_value()?); - } - GeneratedField::ProofAck => { - if proof_ack__.is_some() { - return Err(serde::de::Error::duplicate_field("proofAck")); - } - proof_ack__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - GeneratedField::Signer => { - if signer__.is_some() { - return Err(serde::de::Error::duplicate_field("signer")); - } - signer__ = Some(map.next_value()?); - } - } - } - Ok(MsgConnectionOpenConfirm { - connection_id: connection_id__.unwrap_or_default(), - proof_ack: proof_ack__.unwrap_or_default(), - proof_height: proof_height__, - signer: signer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.MsgConnectionOpenConfirm", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgConnectionOpenConfirmResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer.serialize_struct( - "ibc.core.connection.v1.MsgConnectionOpenConfirmResponse", - len, - )?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgConnectionOpenConfirmResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgConnectionOpenConfirmResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct ibc.core.connection.v1.MsgConnectionOpenConfirmResponse") - } - - 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(MsgConnectionOpenConfirmResponse {}) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.MsgConnectionOpenConfirmResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgConnectionOpenInit { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_id.is_empty() { - len += 1; - } - if self.counterparty.is_some() { - len += 1; - } - if self.version.is_some() { - len += 1; - } - if self.delay_period != 0 { - len += 1; - } - if !self.signer.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.connection.v1.MsgConnectionOpenInit", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - if let Some(v) = self.counterparty.as_ref() { - struct_ser.serialize_field("counterparty", v)?; - } - if let Some(v) = self.version.as_ref() { - struct_ser.serialize_field("version", v)?; - } - if self.delay_period != 0 { - struct_ser.serialize_field( - "delayPeriod", - ToString::to_string(&self.delay_period).as_str(), - )?; - } - if !self.signer.is_empty() { - struct_ser.serialize_field("signer", &self.signer)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgConnectionOpenInit { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "client_id", - "clientId", - "counterparty", - "version", - "delay_period", - "delayPeriod", - "signer", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientId, - Counterparty, - Version, - DelayPeriod, - Signer, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "counterparty" => Ok(GeneratedField::Counterparty), - "version" => Ok(GeneratedField::Version), - "delayPeriod" | "delay_period" => Ok(GeneratedField::DelayPeriod), - "signer" => Ok(GeneratedField::Signer), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgConnectionOpenInit; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.MsgConnectionOpenInit") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_id__ = None; - let mut counterparty__ = None; - let mut version__ = None; - let mut delay_period__ = None; - let mut signer__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - GeneratedField::Counterparty => { - if counterparty__.is_some() { - return Err(serde::de::Error::duplicate_field("counterparty")); - } - counterparty__ = map.next_value()?; - } - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); - } - version__ = map.next_value()?; - } - GeneratedField::DelayPeriod => { - if delay_period__.is_some() { - return Err(serde::de::Error::duplicate_field("delayPeriod")); - } - delay_period__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Signer => { - if signer__.is_some() { - return Err(serde::de::Error::duplicate_field("signer")); - } - signer__ = Some(map.next_value()?); - } - } - } - Ok(MsgConnectionOpenInit { - client_id: client_id__.unwrap_or_default(), - counterparty: counterparty__, - version: version__, - delay_period: delay_period__.unwrap_or_default(), - signer: signer__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.MsgConnectionOpenInit", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgConnectionOpenInitResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer - .serialize_struct("ibc.core.connection.v1.MsgConnectionOpenInitResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgConnectionOpenInitResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgConnectionOpenInitResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.MsgConnectionOpenInitResponse") - } - - 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(MsgConnectionOpenInitResponse {}) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.MsgConnectionOpenInitResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgConnectionOpenTry { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_id.is_empty() { - len += 1; - } - if !self.previous_connection_id.is_empty() { - len += 1; - } - if self.client_state.is_some() { - len += 1; - } - if self.counterparty.is_some() { - len += 1; - } - if self.delay_period != 0 { - len += 1; - } - if !self.counterparty_versions.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - if !self.proof_init.is_empty() { - len += 1; - } - if !self.proof_client.is_empty() { - len += 1; - } - if !self.proof_consensus.is_empty() { - len += 1; - } - if self.consensus_height.is_some() { - len += 1; - } - if !self.signer.is_empty() { - len += 1; - } - if !self.host_consensus_state_proof.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.connection.v1.MsgConnectionOpenTry", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - if !self.previous_connection_id.is_empty() { - struct_ser.serialize_field("previousConnectionId", &self.previous_connection_id)?; - } - if let Some(v) = self.client_state.as_ref() { - struct_ser.serialize_field("clientState", v)?; - } - if let Some(v) = self.counterparty.as_ref() { - struct_ser.serialize_field("counterparty", v)?; - } - if self.delay_period != 0 { - struct_ser.serialize_field( - "delayPeriod", - ToString::to_string(&self.delay_period).as_str(), - )?; - } - if !self.counterparty_versions.is_empty() { - struct_ser.serialize_field("counterpartyVersions", &self.counterparty_versions)?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - if !self.proof_init.is_empty() { - struct_ser.serialize_field( - "proofInit", - pbjson::private::base64::encode(&self.proof_init).as_str(), - )?; - } - if !self.proof_client.is_empty() { - struct_ser.serialize_field( - "proofClient", - pbjson::private::base64::encode(&self.proof_client).as_str(), - )?; - } - if !self.proof_consensus.is_empty() { - struct_ser.serialize_field( - "proofConsensus", - pbjson::private::base64::encode(&self.proof_consensus).as_str(), - )?; - } - if let Some(v) = self.consensus_height.as_ref() { - struct_ser.serialize_field("consensusHeight", v)?; - } - if !self.signer.is_empty() { - struct_ser.serialize_field("signer", &self.signer)?; - } - if !self.host_consensus_state_proof.is_empty() { - struct_ser.serialize_field( - "hostConsensusStateProof", - pbjson::private::base64::encode(&self.host_consensus_state_proof).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgConnectionOpenTry { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "client_id", - "clientId", - "previous_connection_id", - "previousConnectionId", - "client_state", - "clientState", - "counterparty", - "delay_period", - "delayPeriod", - "counterparty_versions", - "counterpartyVersions", - "proof_height", - "proofHeight", - "proof_init", - "proofInit", - "proof_client", - "proofClient", - "proof_consensus", - "proofConsensus", - "consensus_height", - "consensusHeight", - "signer", - "host_consensus_state_proof", - "hostConsensusStateProof", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientId, - PreviousConnectionId, - ClientState, - Counterparty, - DelayPeriod, - CounterpartyVersions, - ProofHeight, - ProofInit, - ProofClient, - ProofConsensus, - ConsensusHeight, - Signer, - HostConsensusStateProof, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "previousConnectionId" | "previous_connection_id" => { - Ok(GeneratedField::PreviousConnectionId) - } - "clientState" | "client_state" => Ok(GeneratedField::ClientState), - "counterparty" => Ok(GeneratedField::Counterparty), - "delayPeriod" | "delay_period" => Ok(GeneratedField::DelayPeriod), - "counterpartyVersions" | "counterparty_versions" => { - Ok(GeneratedField::CounterpartyVersions) - } - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - "proofInit" | "proof_init" => Ok(GeneratedField::ProofInit), - "proofClient" | "proof_client" => Ok(GeneratedField::ProofClient), - "proofConsensus" | "proof_consensus" => { - Ok(GeneratedField::ProofConsensus) - } - "consensusHeight" | "consensus_height" => { - Ok(GeneratedField::ConsensusHeight) - } - "signer" => Ok(GeneratedField::Signer), - "hostConsensusStateProof" | "host_consensus_state_proof" => { - Ok(GeneratedField::HostConsensusStateProof) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgConnectionOpenTry; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.MsgConnectionOpenTry") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_id__ = None; - let mut previous_connection_id__ = None; - let mut client_state__ = None; - let mut counterparty__ = None; - let mut delay_period__ = None; - let mut counterparty_versions__ = None; - let mut proof_height__ = None; - let mut proof_init__ = None; - let mut proof_client__ = None; - let mut proof_consensus__ = None; - let mut consensus_height__ = None; - let mut signer__ = None; - let mut host_consensus_state_proof__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - GeneratedField::PreviousConnectionId => { - if previous_connection_id__.is_some() { - return Err(serde::de::Error::duplicate_field( - "previousConnectionId", - )); - } - previous_connection_id__ = Some(map.next_value()?); - } - GeneratedField::ClientState => { - if client_state__.is_some() { - return Err(serde::de::Error::duplicate_field("clientState")); - } - client_state__ = map.next_value()?; - } - GeneratedField::Counterparty => { - if counterparty__.is_some() { - return Err(serde::de::Error::duplicate_field("counterparty")); - } - counterparty__ = map.next_value()?; - } - GeneratedField::DelayPeriod => { - if delay_period__.is_some() { - return Err(serde::de::Error::duplicate_field("delayPeriod")); - } - delay_period__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::CounterpartyVersions => { - if counterparty_versions__.is_some() { - return Err(serde::de::Error::duplicate_field( - "counterpartyVersions", - )); - } - counterparty_versions__ = Some(map.next_value()?); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - GeneratedField::ProofInit => { - if proof_init__.is_some() { - return Err(serde::de::Error::duplicate_field("proofInit")); - } - proof_init__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofClient => { - if proof_client__.is_some() { - return Err(serde::de::Error::duplicate_field("proofClient")); - } - proof_client__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofConsensus => { - if proof_consensus__.is_some() { - return Err(serde::de::Error::duplicate_field("proofConsensus")); - } - proof_consensus__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ConsensusHeight => { - if consensus_height__.is_some() { - return Err(serde::de::Error::duplicate_field("consensusHeight")); - } - consensus_height__ = map.next_value()?; - } - GeneratedField::Signer => { - if signer__.is_some() { - return Err(serde::de::Error::duplicate_field("signer")); - } - signer__ = Some(map.next_value()?); - } - GeneratedField::HostConsensusStateProof => { - if host_consensus_state_proof__.is_some() { - return Err(serde::de::Error::duplicate_field( - "hostConsensusStateProof", - )); - } - host_consensus_state_proof__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - } - } - Ok(MsgConnectionOpenTry { - client_id: client_id__.unwrap_or_default(), - previous_connection_id: previous_connection_id__.unwrap_or_default(), - client_state: client_state__, - counterparty: counterparty__, - delay_period: delay_period__.unwrap_or_default(), - counterparty_versions: counterparty_versions__.unwrap_or_default(), - proof_height: proof_height__, - proof_init: proof_init__.unwrap_or_default(), - proof_client: proof_client__.unwrap_or_default(), - proof_consensus: proof_consensus__.unwrap_or_default(), - consensus_height: consensus_height__, - signer: signer__.unwrap_or_default(), - host_consensus_state_proof: host_consensus_state_proof__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.MsgConnectionOpenTry", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for MsgConnectionOpenTryResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer - .serialize_struct("ibc.core.connection.v1.MsgConnectionOpenTryResponse", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for MsgConnectionOpenTryResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = MsgConnectionOpenTryResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.MsgConnectionOpenTryResponse") - } - - 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(MsgConnectionOpenTryResponse {}) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.MsgConnectionOpenTryResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -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_expected_time_per_block != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("ibc.core.connection.v1.Params", len)?; - if self.max_expected_time_per_block != 0 { - struct_ser.serialize_field( - "maxExpectedTimePerBlock", - ToString::to_string(&self.max_expected_time_per_block).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Params { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["max_expected_time_per_block", "maxExpectedTimePerBlock"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - MaxExpectedTimePerBlock, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "maxExpectedTimePerBlock" | "max_expected_time_per_block" => { - Ok(GeneratedField::MaxExpectedTimePerBlock) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Params; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.Params") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut max_expected_time_per_block__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::MaxExpectedTimePerBlock => { - if max_expected_time_per_block__.is_some() { - return Err(serde::de::Error::duplicate_field( - "maxExpectedTimePerBlock", - )); - } - max_expected_time_per_block__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(Params { - max_expected_time_per_block: max_expected_time_per_block__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("ibc.core.connection.v1.Params", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for QueryClientConnectionsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_id.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.connection.v1.QueryClientConnectionsRequest", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryClientConnectionsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["client_id", "clientId"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryClientConnectionsRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.QueryClientConnectionsRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - } - } - Ok(QueryClientConnectionsRequest { - client_id: client_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.QueryClientConnectionsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryClientConnectionsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.connection_paths.is_empty() { - len += 1; - } - if !self.proof.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.connection.v1.QueryClientConnectionsResponse", len)?; - if !self.connection_paths.is_empty() { - struct_ser.serialize_field("connectionPaths", &self.connection_paths)?; - } - if !self.proof.is_empty() { - struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryClientConnectionsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "connection_paths", - "connectionPaths", - "proof", - "proof_height", - "proofHeight", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ConnectionPaths, - Proof, - ProofHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "connectionPaths" | "connection_paths" => { - Ok(GeneratedField::ConnectionPaths) - } - "proof" => Ok(GeneratedField::Proof), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryClientConnectionsResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.QueryClientConnectionsResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut connection_paths__ = None; - let mut proof__ = None; - let mut proof_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ConnectionPaths => { - if connection_paths__.is_some() { - return Err(serde::de::Error::duplicate_field("connectionPaths")); - } - connection_paths__ = Some(map.next_value()?); - } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); - } - proof__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - } - } - Ok(QueryClientConnectionsResponse { - connection_paths: connection_paths__.unwrap_or_default(), - proof: proof__.unwrap_or_default(), - proof_height: proof_height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.QueryClientConnectionsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryConnectionClientStateRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.connection_id.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.core.connection.v1.QueryConnectionClientStateRequest", - len, - )?; - if !self.connection_id.is_empty() { - struct_ser.serialize_field("connectionId", &self.connection_id)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryConnectionClientStateRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["connection_id", "connectionId"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ConnectionId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryConnectionClientStateRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct ibc.core.connection.v1.QueryConnectionClientStateRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut connection_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ConnectionId => { - if connection_id__.is_some() { - return Err(serde::de::Error::duplicate_field("connectionId")); - } - connection_id__ = Some(map.next_value()?); - } - } - } - Ok(QueryConnectionClientStateRequest { - connection_id: connection_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.QueryConnectionClientStateRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryConnectionClientStateResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.identified_client_state.is_some() { - len += 1; - } - if !self.proof.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.core.connection.v1.QueryConnectionClientStateResponse", - len, - )?; - if let Some(v) = self.identified_client_state.as_ref() { - struct_ser.serialize_field("identifiedClientState", v)?; - } - if !self.proof.is_empty() { - struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryConnectionClientStateResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "identified_client_state", - "identifiedClientState", - "proof", - "proof_height", - "proofHeight", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - IdentifiedClientState, - Proof, - ProofHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "identifiedClientState" | "identified_client_state" => { - Ok(GeneratedField::IdentifiedClientState) - } - "proof" => Ok(GeneratedField::Proof), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryConnectionClientStateResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct ibc.core.connection.v1.QueryConnectionClientStateResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut identified_client_state__ = None; - let mut proof__ = None; - let mut proof_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::IdentifiedClientState => { - if identified_client_state__.is_some() { - return Err(serde::de::Error::duplicate_field( - "identifiedClientState", - )); - } - identified_client_state__ = map.next_value()?; - } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); - } - proof__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - } - } - Ok(QueryConnectionClientStateResponse { - identified_client_state: identified_client_state__, - proof: proof__.unwrap_or_default(), - proof_height: proof_height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.QueryConnectionClientStateResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryConnectionConsensusStateRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.connection_id.is_empty() { - len += 1; - } - if self.revision_number != 0 { - len += 1; - } - if self.revision_height != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.core.connection.v1.QueryConnectionConsensusStateRequest", - len, - )?; - if !self.connection_id.is_empty() { - struct_ser.serialize_field("connectionId", &self.connection_id)?; - } - if self.revision_number != 0 { - struct_ser.serialize_field( - "revisionNumber", - ToString::to_string(&self.revision_number).as_str(), - )?; - } - if self.revision_height != 0 { - struct_ser.serialize_field( - "revisionHeight", - ToString::to_string(&self.revision_height).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryConnectionConsensusStateRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "connection_id", - "connectionId", - "revision_number", - "revisionNumber", - "revision_height", - "revisionHeight", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ConnectionId, - RevisionNumber, - RevisionHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), - "revisionNumber" | "revision_number" => { - Ok(GeneratedField::RevisionNumber) - } - "revisionHeight" | "revision_height" => { - Ok(GeneratedField::RevisionHeight) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryConnectionConsensusStateRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct ibc.core.connection.v1.QueryConnectionConsensusStateRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut connection_id__ = None; - let mut revision_number__ = None; - let mut revision_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ConnectionId => { - if connection_id__.is_some() { - return Err(serde::de::Error::duplicate_field("connectionId")); - } - connection_id__ = Some(map.next_value()?); - } - GeneratedField::RevisionNumber => { - if revision_number__.is_some() { - return Err(serde::de::Error::duplicate_field("revisionNumber")); - } - revision_number__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::RevisionHeight => { - if revision_height__.is_some() { - return Err(serde::de::Error::duplicate_field("revisionHeight")); - } - revision_height__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(QueryConnectionConsensusStateRequest { - connection_id: connection_id__.unwrap_or_default(), - revision_number: revision_number__.unwrap_or_default(), - revision_height: revision_height__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.QueryConnectionConsensusStateRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryConnectionConsensusStateResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.consensus_state.is_some() { - len += 1; - } - if !self.client_id.is_empty() { - len += 1; - } - if !self.proof.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.core.connection.v1.QueryConnectionConsensusStateResponse", - len, - )?; - if let Some(v) = self.consensus_state.as_ref() { - struct_ser.serialize_field("consensusState", v)?; - } - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - if !self.proof.is_empty() { - struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryConnectionConsensusStateResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "consensus_state", - "consensusState", - "client_id", - "clientId", - "proof", - "proof_height", - "proofHeight", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ConsensusState, - ClientId, - Proof, - ProofHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "consensusState" | "consensus_state" => { - Ok(GeneratedField::ConsensusState) - } - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "proof" => Ok(GeneratedField::Proof), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryConnectionConsensusStateResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str( - "struct ibc.core.connection.v1.QueryConnectionConsensusStateResponse", - ) - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut consensus_state__ = None; - let mut client_id__ = None; - let mut proof__ = None; - let mut proof_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ConsensusState => { - if consensus_state__.is_some() { - return Err(serde::de::Error::duplicate_field("consensusState")); - } - consensus_state__ = map.next_value()?; - } - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); - } - proof__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - } - } - Ok(QueryConnectionConsensusStateResponse { - consensus_state: consensus_state__, - client_id: client_id__.unwrap_or_default(), - proof: proof__.unwrap_or_default(), - proof_height: proof_height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.QueryConnectionConsensusStateResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryConnectionParamsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let len = 0; - let struct_ser = serializer - .serialize_struct("ibc.core.connection.v1.QueryConnectionParamsRequest", len)?; - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryConnectionParamsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField {} - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::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 = QueryConnectionParamsRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.QueryConnectionParamsRequest") - } - - 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(QueryConnectionParamsRequest {}) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.QueryConnectionParamsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryConnectionParamsResponse { - #[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("ibc.core.connection.v1.QueryConnectionParamsResponse", len)?; - if let Some(v) = self.params.as_ref() { - struct_ser.serialize_field("params", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryConnectionParamsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["params"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Params, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = QueryConnectionParamsResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.QueryConnectionParamsResponse") - } - - 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(QueryConnectionParamsResponse { params: params__ }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.QueryConnectionParamsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryConnectionRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.connection_id.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.connection.v1.QueryConnectionRequest", len)?; - if !self.connection_id.is_empty() { - struct_ser.serialize_field("connectionId", &self.connection_id)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryConnectionRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["connection_id", "connectionId"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ConnectionId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryConnectionRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.QueryConnectionRequest") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut connection_id__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ConnectionId => { - if connection_id__.is_some() { - return Err(serde::de::Error::duplicate_field("connectionId")); - } - connection_id__ = Some(map.next_value()?); - } - } - } - Ok(QueryConnectionRequest { - connection_id: connection_id__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.QueryConnectionRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryConnectionResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.connection.is_some() { - len += 1; - } - if !self.proof.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.connection.v1.QueryConnectionResponse", len)?; - if let Some(v) = self.connection.as_ref() { - struct_ser.serialize_field("connection", v)?; - } - if !self.proof.is_empty() { - struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryConnectionResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["connection", "proof", "proof_height", "proofHeight"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Connection, - Proof, - ProofHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "connection" => Ok(GeneratedField::Connection), - "proof" => Ok(GeneratedField::Proof), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryConnectionResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.QueryConnectionResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut connection__ = None; - let mut proof__ = None; - let mut proof_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Connection => { - if connection__.is_some() { - return Err(serde::de::Error::duplicate_field("connection")); - } - connection__ = map.next_value()?; - } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); - } - proof__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map.next_value()?; - } - } - } - Ok(QueryConnectionResponse { - connection: connection__, - proof: proof__.unwrap_or_default(), - proof_height: proof_height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.QueryConnectionResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryConnectionsRequest { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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("ibc.core.connection.v1.QueryConnectionsRequest", len)?; - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryConnectionsRequest { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["pagination"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Pagination, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = QueryConnectionsRequest; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.QueryConnectionsRequest") - } - - 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(QueryConnectionsRequest { - pagination: pagination__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.QueryConnectionsRequest", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for QueryConnectionsResponse { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.connections.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - if self.height.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.connection.v1.QueryConnectionsResponse", len)?; - if !self.connections.is_empty() { - struct_ser.serialize_field("connections", &self.connections)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - if let Some(v) = self.height.as_ref() { - struct_ser.serialize_field("height", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for QueryConnectionsResponse { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["connections", "pagination", "height"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Connections, - Pagination, - Height, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "connections" => Ok(GeneratedField::Connections), - "pagination" => Ok(GeneratedField::Pagination), - "height" => Ok(GeneratedField::Height), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryConnectionsResponse; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.QueryConnectionsResponse") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut connections__ = None; - let mut pagination__ = None; - let mut height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Connections => { - if connections__.is_some() { - return Err(serde::de::Error::duplicate_field("connections")); - } - connections__ = Some(map.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map.next_value()?; - } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); - } - height__ = map.next_value()?; - } - } - } - Ok(QueryConnectionsResponse { - connections: connections__.unwrap_or_default(), - pagination: pagination__, - height: height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.core.connection.v1.QueryConnectionsResponse", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for State { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::UninitializedUnspecified => "STATE_UNINITIALIZED_UNSPECIFIED", - Self::Init => "STATE_INIT", - Self::Tryopen => "STATE_TRYOPEN", - Self::Open => "STATE_OPEN", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for State { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "STATE_UNINITIALIZED_UNSPECIFIED", - "STATE_INIT", - "STATE_TRYOPEN", - "STATE_OPEN", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = State; - - fn expecting(&self, formatter: &mut 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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(State::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(State::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "STATE_UNINITIALIZED_UNSPECIFIED" => Ok(State::UninitializedUnspecified), - "STATE_INIT" => Ok(State::Init), - "STATE_TRYOPEN" => Ok(State::Tryopen), - "STATE_OPEN" => Ok(State::Open), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for Version { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.identifier.is_empty() { - len += 1; - } - if !self.features.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("ibc.core.connection.v1.Version", len)?; - if !self.identifier.is_empty() { - struct_ser.serialize_field("identifier", &self.identifier)?; - } - if !self.features.is_empty() { - struct_ser.serialize_field("features", &self.features)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Version { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["identifier", "features"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Identifier, - Features, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "identifier" => Ok(GeneratedField::Identifier), - "features" => Ok(GeneratedField::Features), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Version; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.connection.v1.Version") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut identifier__ = None; - let mut features__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Identifier => { - if identifier__.is_some() { - return Err(serde::de::Error::duplicate_field("identifier")); - } - identifier__ = Some(map.next_value()?); - } - GeneratedField::Features => { - if features__.is_some() { - return Err(serde::de::Error::duplicate_field("features")); - } - features__ = Some(map.next_value()?); - } - } - } - Ok(Version { - identifier: identifier__.unwrap_or_default(), - features: features__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("ibc.core.connection.v1.Version", FIELDS, GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/ibc.core.types.v1.rs b/packages/proto/src/gen/ibc.core.types.v1.rs index 91e092f..3c77fdb 100644 --- a/packages/proto/src/gen/ibc.core.types.v1.rs +++ b/packages/proto/src/gen/ibc.core.types.v1.rs @@ -1,5 +1,6 @@ // @generated /// GenesisState defines the ibc module's genesis state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -100,5 +101,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x08, 0xee, 0xfb, 0x03, 0x12, 0x03, 0x15, 0x25, 0x56, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("ibc.core.types.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/ibc.core.types.v1.serde.rs b/packages/proto/src/gen/ibc.core.types.v1.serde.rs deleted file mode 100644 index ad55001..0000000 --- a/packages/proto/src/gen/ibc.core.types.v1.serde.rs +++ /dev/null @@ -1,136 +0,0 @@ -// @generated -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.client_genesis.is_some() { - len += 1; - } - if self.connection_genesis.is_some() { - len += 1; - } - if self.channel_genesis.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("ibc.core.types.v1.GenesisState", len)?; - if let Some(v) = self.client_genesis.as_ref() { - struct_ser.serialize_field("clientGenesis", v)?; - } - if let Some(v) = self.connection_genesis.as_ref() { - struct_ser.serialize_field("connectionGenesis", v)?; - } - if let Some(v) = self.channel_genesis.as_ref() { - struct_ser.serialize_field("channelGenesis", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for GenesisState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "client_genesis", - "clientGenesis", - "connection_genesis", - "connectionGenesis", - "channel_genesis", - "channelGenesis", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientGenesis, - ConnectionGenesis, - ChannelGenesis, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientGenesis" | "client_genesis" => Ok(GeneratedField::ClientGenesis), - "connectionGenesis" | "connection_genesis" => { - Ok(GeneratedField::ConnectionGenesis) - } - "channelGenesis" | "channel_genesis" => { - Ok(GeneratedField::ChannelGenesis) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GenesisState; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.types.v1.GenesisState") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_genesis__ = None; - let mut connection_genesis__ = None; - let mut channel_genesis__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientGenesis => { - if client_genesis__.is_some() { - return Err(serde::de::Error::duplicate_field("clientGenesis")); - } - client_genesis__ = map.next_value()?; - } - GeneratedField::ConnectionGenesis => { - if connection_genesis__.is_some() { - return Err(serde::de::Error::duplicate_field("connectionGenesis")); - } - connection_genesis__ = map.next_value()?; - } - GeneratedField::ChannelGenesis => { - if channel_genesis__.is_some() { - return Err(serde::de::Error::duplicate_field("channelGenesis")); - } - channel_genesis__ = map.next_value()?; - } - } - } - Ok(GenesisState { - client_genesis: client_genesis__, - connection_genesis: connection_genesis__, - channel_genesis: channel_genesis__, - }) - } - } - deserializer.deserialize_struct("ibc.core.types.v1.GenesisState", FIELDS, GeneratedVisitor) - } -} diff --git a/packages/proto/src/gen/ibc.lightclients.localhost.v2.rs b/packages/proto/src/gen/ibc.lightclients.localhost.v2.rs index 2915ce9..a51c132 100644 --- a/packages/proto/src/gen/ibc.lightclients.localhost.v2.rs +++ b/packages/proto/src/gen/ibc.lightclients.localhost.v2.rs @@ -1,5 +1,6 @@ // @generated /// ClientState defines the 09-localhost client state +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientState { @@ -57,5 +58,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x2e, 0x4c, 0x0a, 0x0f, 0x0a, 0x08, 0x04, 0x00, 0x02, 0x00, 0x08, 0xe9, 0xfb, 0x03, 0x12, 0x03, 0x0e, 0x2f, 0x4b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("ibc.lightclients.localhost.v2.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/ibc.lightclients.localhost.v2.serde.rs b/packages/proto/src/gen/ibc.lightclients.localhost.v2.serde.rs deleted file mode 100644 index 0a91981..0000000 --- a/packages/proto/src/gen/ibc.lightclients.localhost.v2.serde.rs +++ /dev/null @@ -1,98 +0,0 @@ -// @generated -impl serde::Serialize for ClientState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.latest_height.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.localhost.v2.ClientState", len)?; - if let Some(v) = self.latest_height.as_ref() { - struct_ser.serialize_field("latestHeight", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ClientState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["latest_height", "latestHeight"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - LatestHeight, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "latestHeight" | "latest_height" => Ok(GeneratedField::LatestHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ClientState; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.localhost.v2.ClientState") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut latest_height__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::LatestHeight => { - if latest_height__.is_some() { - return Err(serde::de::Error::duplicate_field("latestHeight")); - } - latest_height__ = map.next_value()?; - } - } - } - Ok(ClientState { - latest_height: latest_height__, - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.localhost.v2.ClientState", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/ibc.lightclients.solomachine.v2.rs b/packages/proto/src/gen/ibc.lightclients.solomachine.v2.rs index 6ca12fb..5bfbff9 100644 --- a/packages/proto/src/gen/ibc.lightclients.solomachine.v2.rs +++ b/packages/proto/src/gen/ibc.lightclients.solomachine.v2.rs @@ -1,6 +1,7 @@ // @generated /// ClientState defines a solo machine client that tracks the current consensus /// state and if the client is frozen. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientState { @@ -27,6 +28,7 @@ impl ::prost::Name for ClientState { /// ConsensusState defines a solo machine consensus state. The sequence of a /// consensus state is contained in the "height" key used in storing the /// consensus state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConsensusState { @@ -49,6 +51,7 @@ impl ::prost::Name for ConsensusState { } } /// Header defines a solo machine consensus header +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Header { @@ -73,6 +76,7 @@ impl ::prost::Name for Header { } /// Misbehaviour defines misbehaviour for a solo machine which consists /// of a sequence and two signatures over different messages at that sequence. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Misbehaviour { @@ -94,6 +98,7 @@ impl ::prost::Name for Misbehaviour { } /// SignatureAndData contains a signature and the data signed over to create that /// signature. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SignatureAndData { @@ -115,6 +120,7 @@ impl ::prost::Name for SignatureAndData { } /// TimestampedSignatureData contains the signature data and the timestamp of the /// signature. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TimestampedSignatureData { @@ -131,6 +137,7 @@ impl ::prost::Name for TimestampedSignatureData { } } /// SignBytes defines the signed bytes used for signature verification. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SignBytes { @@ -155,6 +162,7 @@ impl ::prost::Name for SignBytes { } } /// HeaderData returns the SignBytes data for update verification. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HeaderData { @@ -173,6 +181,7 @@ impl ::prost::Name for HeaderData { } } /// ClientStateData returns the SignBytes data for client state verification. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientStateData { @@ -190,6 +199,7 @@ impl ::prost::Name for ClientStateData { } /// ConsensusStateData returns the SignBytes data for consensus state /// verification. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConsensusStateData { @@ -207,6 +217,7 @@ impl ::prost::Name for ConsensusStateData { } /// ConnectionStateData returns the SignBytes data for connection state /// verification. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConnectionStateData { @@ -225,6 +236,7 @@ impl ::prost::Name for ConnectionStateData { } /// ChannelStateData returns the SignBytes data for channel state /// verification. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ChannelStateData { @@ -242,6 +254,7 @@ impl ::prost::Name for ChannelStateData { } /// PacketCommitmentData returns the SignBytes data for packet commitment /// verification. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PacketCommitmentData { @@ -259,6 +272,7 @@ impl ::prost::Name for PacketCommitmentData { } /// PacketAcknowledgementData returns the SignBytes data for acknowledgement /// verification. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PacketAcknowledgementData { @@ -276,6 +290,7 @@ impl ::prost::Name for PacketAcknowledgementData { } /// PacketReceiptAbsenceData returns the SignBytes data for /// packet receipt absence verification. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PacketReceiptAbsenceData { @@ -291,6 +306,7 @@ impl ::prost::Name for PacketReceiptAbsenceData { } /// NextSequenceRecvData returns the SignBytes data for verification of the next /// sequence to be received. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct NextSequenceRecvData { @@ -308,7 +324,19 @@ impl ::prost::Name for NextSequenceRecvData { } /// DataType defines the type of solo machine proof being created. This is done /// to preserve uniqueness of different data sign byte encodings. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[derive( + ::serde::Serialize, + ::serde::Deserialize, + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration, +)] #[repr(i32)] pub enum DataType { /// Default State @@ -1041,5 +1069,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x1b, 0x4c, 0x0a, 0x10, 0x0a, 0x08, 0x04, 0x0f, 0x02, 0x01, 0x08, 0xee, 0xfb, 0x03, 0x12, 0x04, 0xbb, 0x01, 0x1c, 0x4b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("ibc.lightclients.solomachine.v2.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/ibc.lightclients.solomachine.v2.serde.rs b/packages/proto/src/gen/ibc.lightclients.solomachine.v2.serde.rs deleted file mode 100644 index 1895c27..0000000 --- a/packages/proto/src/gen/ibc.lightclients.solomachine.v2.serde.rs +++ /dev/null @@ -1,2281 +0,0 @@ -// @generated -impl serde::Serialize for ChannelStateData { - #[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.channel.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v2.ChannelStateData", len)?; - if !self.path.is_empty() { - struct_ser - .serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; - } - if let Some(v) = self.channel.as_ref() { - struct_ser.serialize_field("channel", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ChannelStateData { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["path", "channel"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Path, - Channel, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "channel" => Ok(GeneratedField::Channel), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ChannelStateData; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v2.ChannelStateData") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut path__ = None; - let mut channel__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); - } - path__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Channel => { - if channel__.is_some() { - return Err(serde::de::Error::duplicate_field("channel")); - } - channel__ = map.next_value()?; - } - } - } - Ok(ChannelStateData { - path: path__.unwrap_or_default(), - channel: channel__, - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v2.ChannelStateData", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ClientState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.sequence != 0 { - len += 1; - } - if self.is_frozen { - len += 1; - } - if self.consensus_state.is_some() { - len += 1; - } - if self.allow_update_after_proposal { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v2.ClientState", len)?; - if self.sequence != 0 { - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - if self.is_frozen { - struct_ser.serialize_field("isFrozen", &self.is_frozen)?; - } - if let Some(v) = self.consensus_state.as_ref() { - struct_ser.serialize_field("consensusState", v)?; - } - if self.allow_update_after_proposal { - struct_ser.serialize_field( - "allowUpdateAfterProposal", - &self.allow_update_after_proposal, - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ClientState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "sequence", - "is_frozen", - "isFrozen", - "consensus_state", - "consensusState", - "allow_update_after_proposal", - "allowUpdateAfterProposal", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Sequence, - IsFrozen, - ConsensusState, - AllowUpdateAfterProposal, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "sequence" => Ok(GeneratedField::Sequence), - "isFrozen" | "is_frozen" => Ok(GeneratedField::IsFrozen), - "consensusState" | "consensus_state" => { - Ok(GeneratedField::ConsensusState) - } - "allowUpdateAfterProposal" | "allow_update_after_proposal" => { - Ok(GeneratedField::AllowUpdateAfterProposal) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ClientState; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v2.ClientState") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sequence__ = None; - let mut is_frozen__ = None; - let mut consensus_state__ = None; - let mut allow_update_after_proposal__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::IsFrozen => { - if is_frozen__.is_some() { - return Err(serde::de::Error::duplicate_field("isFrozen")); - } - is_frozen__ = Some(map.next_value()?); - } - GeneratedField::ConsensusState => { - if consensus_state__.is_some() { - return Err(serde::de::Error::duplicate_field("consensusState")); - } - consensus_state__ = map.next_value()?; - } - GeneratedField::AllowUpdateAfterProposal => { - if allow_update_after_proposal__.is_some() { - return Err(serde::de::Error::duplicate_field( - "allowUpdateAfterProposal", - )); - } - allow_update_after_proposal__ = Some(map.next_value()?); - } - } - } - Ok(ClientState { - sequence: sequence__.unwrap_or_default(), - is_frozen: is_frozen__.unwrap_or_default(), - consensus_state: consensus_state__, - allow_update_after_proposal: allow_update_after_proposal__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v2.ClientState", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ClientStateData { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.path.is_empty() { - len += 1; - } - if self.client_state.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v2.ClientStateData", len)?; - if !self.path.is_empty() { - struct_ser - .serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; - } - if let Some(v) = self.client_state.as_ref() { - struct_ser.serialize_field("clientState", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ClientStateData { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["path", "client_state", "clientState"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Path, - ClientState, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "clientState" | "client_state" => Ok(GeneratedField::ClientState), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ClientStateData; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v2.ClientStateData") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut path__ = None; - let mut client_state__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); - } - path__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ClientState => { - if client_state__.is_some() { - return Err(serde::de::Error::duplicate_field("clientState")); - } - client_state__ = map.next_value()?; - } - } - } - Ok(ClientStateData { - path: path__.unwrap_or_default(), - client_state: client_state__, - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v2.ClientStateData", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ConnectionStateData { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.path.is_empty() { - len += 1; - } - if self.connection.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.lightclients.solomachine.v2.ConnectionStateData", len)?; - if !self.path.is_empty() { - struct_ser - .serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; - } - if let Some(v) = self.connection.as_ref() { - struct_ser.serialize_field("connection", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ConnectionStateData { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["path", "connection"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Path, - Connection, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "connection" => Ok(GeneratedField::Connection), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ConnectionStateData; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v2.ConnectionStateData") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut path__ = None; - let mut connection__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); - } - path__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Connection => { - if connection__.is_some() { - return Err(serde::de::Error::duplicate_field("connection")); - } - connection__ = map.next_value()?; - } - } - } - Ok(ConnectionStateData { - path: path__.unwrap_or_default(), - connection: connection__, - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v2.ConnectionStateData", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ConsensusState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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.diversifier.is_empty() { - len += 1; - } - if self.timestamp != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v2.ConsensusState", len)?; - if let Some(v) = self.public_key.as_ref() { - struct_ser.serialize_field("publicKey", v)?; - } - if !self.diversifier.is_empty() { - struct_ser.serialize_field("diversifier", &self.diversifier)?; - } - if self.timestamp != 0 { - struct_ser - .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ConsensusState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["public_key", "publicKey", "diversifier", "timestamp"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PublicKey, - Diversifier, - Timestamp, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "diversifier" => Ok(GeneratedField::Diversifier), - "timestamp" => Ok(GeneratedField::Timestamp), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ConsensusState; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v2.ConsensusState") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut public_key__ = None; - let mut diversifier__ = None; - let mut timestamp__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PublicKey => { - if public_key__.is_some() { - return Err(serde::de::Error::duplicate_field("publicKey")); - } - public_key__ = map.next_value()?; - } - GeneratedField::Diversifier => { - if diversifier__.is_some() { - return Err(serde::de::Error::duplicate_field("diversifier")); - } - diversifier__ = Some(map.next_value()?); - } - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); - } - timestamp__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(ConsensusState { - public_key: public_key__, - diversifier: diversifier__.unwrap_or_default(), - timestamp: timestamp__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v2.ConsensusState", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ConsensusStateData { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.path.is_empty() { - len += 1; - } - if self.consensus_state.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.lightclients.solomachine.v2.ConsensusStateData", len)?; - if !self.path.is_empty() { - struct_ser - .serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; - } - if let Some(v) = self.consensus_state.as_ref() { - struct_ser.serialize_field("consensusState", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ConsensusStateData { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["path", "consensus_state", "consensusState"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Path, - ConsensusState, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "consensusState" | "consensus_state" => { - Ok(GeneratedField::ConsensusState) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ConsensusStateData; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v2.ConsensusStateData") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut path__ = None; - let mut consensus_state__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); - } - path__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ConsensusState => { - if consensus_state__.is_some() { - return Err(serde::de::Error::duplicate_field("consensusState")); - } - consensus_state__ = map.next_value()?; - } - } - } - Ok(ConsensusStateData { - path: path__.unwrap_or_default(), - consensus_state: consensus_state__, - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v2.ConsensusStateData", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for DataType { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::UninitializedUnspecified => "DATA_TYPE_UNINITIALIZED_UNSPECIFIED", - Self::ClientState => "DATA_TYPE_CLIENT_STATE", - Self::ConsensusState => "DATA_TYPE_CONSENSUS_STATE", - Self::ConnectionState => "DATA_TYPE_CONNECTION_STATE", - Self::ChannelState => "DATA_TYPE_CHANNEL_STATE", - Self::PacketCommitment => "DATA_TYPE_PACKET_COMMITMENT", - Self::PacketAcknowledgement => "DATA_TYPE_PACKET_ACKNOWLEDGEMENT", - Self::PacketReceiptAbsence => "DATA_TYPE_PACKET_RECEIPT_ABSENCE", - Self::NextSequenceRecv => "DATA_TYPE_NEXT_SEQUENCE_RECV", - Self::Header => "DATA_TYPE_HEADER", - }; - serializer.serialize_str(variant) - } -} -impl<'de> serde::Deserialize<'de> for DataType { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "DATA_TYPE_UNINITIALIZED_UNSPECIFIED", - "DATA_TYPE_CLIENT_STATE", - "DATA_TYPE_CONSENSUS_STATE", - "DATA_TYPE_CONNECTION_STATE", - "DATA_TYPE_CHANNEL_STATE", - "DATA_TYPE_PACKET_COMMITMENT", - "DATA_TYPE_PACKET_ACKNOWLEDGEMENT", - "DATA_TYPE_PACKET_RECEIPT_ABSENCE", - "DATA_TYPE_NEXT_SEQUENCE_RECV", - "DATA_TYPE_HEADER", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DataType; - - fn expecting(&self, formatter: &mut 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, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(DataType::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> std::result::Result - where - E: serde::de::Error, - { - use std::convert::TryFrom; - i32::try_from(v) - .ok() - .and_then(DataType::from_i32) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "DATA_TYPE_UNINITIALIZED_UNSPECIFIED" => Ok(DataType::UninitializedUnspecified), - "DATA_TYPE_CLIENT_STATE" => Ok(DataType::ClientState), - "DATA_TYPE_CONSENSUS_STATE" => Ok(DataType::ConsensusState), - "DATA_TYPE_CONNECTION_STATE" => Ok(DataType::ConnectionState), - "DATA_TYPE_CHANNEL_STATE" => Ok(DataType::ChannelState), - "DATA_TYPE_PACKET_COMMITMENT" => Ok(DataType::PacketCommitment), - "DATA_TYPE_PACKET_ACKNOWLEDGEMENT" => Ok(DataType::PacketAcknowledgement), - "DATA_TYPE_PACKET_RECEIPT_ABSENCE" => Ok(DataType::PacketReceiptAbsence), - "DATA_TYPE_NEXT_SEQUENCE_RECV" => Ok(DataType::NextSequenceRecv), - "DATA_TYPE_HEADER" => Ok(DataType::Header), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -impl serde::Serialize for Header { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.sequence != 0 { - len += 1; - } - if self.timestamp != 0 { - len += 1; - } - if !self.signature.is_empty() { - len += 1; - } - if self.new_public_key.is_some() { - len += 1; - } - if !self.new_diversifier.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v2.Header", len)?; - if self.sequence != 0 { - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - if self.timestamp != 0 { - struct_ser - .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; - } - if !self.signature.is_empty() { - struct_ser.serialize_field( - "signature", - pbjson::private::base64::encode(&self.signature).as_str(), - )?; - } - if let Some(v) = self.new_public_key.as_ref() { - struct_ser.serialize_field("newPublicKey", v)?; - } - if !self.new_diversifier.is_empty() { - struct_ser.serialize_field("newDiversifier", &self.new_diversifier)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Header { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "sequence", - "timestamp", - "signature", - "new_public_key", - "newPublicKey", - "new_diversifier", - "newDiversifier", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Sequence, - Timestamp, - Signature, - NewPublicKey, - NewDiversifier, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "sequence" => Ok(GeneratedField::Sequence), - "timestamp" => Ok(GeneratedField::Timestamp), - "signature" => Ok(GeneratedField::Signature), - "newPublicKey" | "new_public_key" => Ok(GeneratedField::NewPublicKey), - "newDiversifier" | "new_diversifier" => { - Ok(GeneratedField::NewDiversifier) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Header; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v2.Header") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sequence__ = None; - let mut timestamp__ = None; - let mut signature__ = None; - let mut new_public_key__ = None; - let mut new_diversifier__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); - } - timestamp__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Signature => { - if signature__.is_some() { - return Err(serde::de::Error::duplicate_field("signature")); - } - signature__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::NewPublicKey => { - if new_public_key__.is_some() { - return Err(serde::de::Error::duplicate_field("newPublicKey")); - } - new_public_key__ = map.next_value()?; - } - GeneratedField::NewDiversifier => { - if new_diversifier__.is_some() { - return Err(serde::de::Error::duplicate_field("newDiversifier")); - } - new_diversifier__ = Some(map.next_value()?); - } - } - } - Ok(Header { - sequence: sequence__.unwrap_or_default(), - timestamp: timestamp__.unwrap_or_default(), - signature: signature__.unwrap_or_default(), - new_public_key: new_public_key__, - new_diversifier: new_diversifier__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v2.Header", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for HeaderData { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.new_pub_key.is_some() { - len += 1; - } - if !self.new_diversifier.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v2.HeaderData", len)?; - if let Some(v) = self.new_pub_key.as_ref() { - struct_ser.serialize_field("newPubKey", v)?; - } - if !self.new_diversifier.is_empty() { - struct_ser.serialize_field("newDiversifier", &self.new_diversifier)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for HeaderData { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "new_pub_key", - "newPubKey", - "new_diversifier", - "newDiversifier", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - NewPubKey, - NewDiversifier, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "newPubKey" | "new_pub_key" => Ok(GeneratedField::NewPubKey), - "newDiversifier" | "new_diversifier" => { - Ok(GeneratedField::NewDiversifier) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = HeaderData; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v2.HeaderData") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut new_pub_key__ = None; - let mut new_diversifier__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::NewPubKey => { - if new_pub_key__.is_some() { - return Err(serde::de::Error::duplicate_field("newPubKey")); - } - new_pub_key__ = map.next_value()?; - } - GeneratedField::NewDiversifier => { - if new_diversifier__.is_some() { - return Err(serde::de::Error::duplicate_field("newDiversifier")); - } - new_diversifier__ = Some(map.next_value()?); - } - } - } - Ok(HeaderData { - new_pub_key: new_pub_key__, - new_diversifier: new_diversifier__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v2.HeaderData", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for Misbehaviour { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_id.is_empty() { - len += 1; - } - if self.sequence != 0 { - len += 1; - } - if self.signature_one.is_some() { - len += 1; - } - if self.signature_two.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v2.Misbehaviour", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - if self.sequence != 0 { - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - if let Some(v) = self.signature_one.as_ref() { - struct_ser.serialize_field("signatureOne", v)?; - } - if let Some(v) = self.signature_two.as_ref() { - struct_ser.serialize_field("signatureTwo", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Misbehaviour { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "client_id", - "clientId", - "sequence", - "signature_one", - "signatureOne", - "signature_two", - "signatureTwo", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientId, - Sequence, - SignatureOne, - SignatureTwo, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "sequence" => Ok(GeneratedField::Sequence), - "signatureOne" | "signature_one" => Ok(GeneratedField::SignatureOne), - "signatureTwo" | "signature_two" => Ok(GeneratedField::SignatureTwo), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Misbehaviour; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v2.Misbehaviour") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_id__ = None; - let mut sequence__ = None; - let mut signature_one__ = None; - let mut signature_two__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::SignatureOne => { - if signature_one__.is_some() { - return Err(serde::de::Error::duplicate_field("signatureOne")); - } - signature_one__ = map.next_value()?; - } - GeneratedField::SignatureTwo => { - if signature_two__.is_some() { - return Err(serde::de::Error::duplicate_field("signatureTwo")); - } - signature_two__ = map.next_value()?; - } - } - } - Ok(Misbehaviour { - client_id: client_id__.unwrap_or_default(), - sequence: sequence__.unwrap_or_default(), - signature_one: signature_one__, - signature_two: signature_two__, - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v2.Misbehaviour", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for NextSequenceRecvData { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.path.is_empty() { - len += 1; - } - if self.next_seq_recv != 0 { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.lightclients.solomachine.v2.NextSequenceRecvData", len)?; - if !self.path.is_empty() { - struct_ser - .serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; - } - if self.next_seq_recv != 0 { - struct_ser.serialize_field( - "nextSeqRecv", - ToString::to_string(&self.next_seq_recv).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for NextSequenceRecvData { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["path", "next_seq_recv", "nextSeqRecv"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Path, - NextSeqRecv, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "nextSeqRecv" | "next_seq_recv" => Ok(GeneratedField::NextSeqRecv), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = NextSequenceRecvData; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v2.NextSequenceRecvData") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut path__ = None; - let mut next_seq_recv__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); - } - path__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::NextSeqRecv => { - if next_seq_recv__.is_some() { - return Err(serde::de::Error::duplicate_field("nextSeqRecv")); - } - next_seq_recv__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(NextSequenceRecvData { - path: path__.unwrap_or_default(), - next_seq_recv: next_seq_recv__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v2.NextSequenceRecvData", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for PacketAcknowledgementData { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.path.is_empty() { - len += 1; - } - if !self.acknowledgement.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.lightclients.solomachine.v2.PacketAcknowledgementData", - len, - )?; - if !self.path.is_empty() { - struct_ser - .serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; - } - if !self.acknowledgement.is_empty() { - struct_ser.serialize_field( - "acknowledgement", - pbjson::private::base64::encode(&self.acknowledgement).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PacketAcknowledgementData { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["path", "acknowledgement"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Path, - Acknowledgement, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "acknowledgement" => Ok(GeneratedField::Acknowledgement), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PacketAcknowledgementData; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct ibc.lightclients.solomachine.v2.PacketAcknowledgementData") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut path__ = None; - let mut acknowledgement__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); - } - path__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Acknowledgement => { - if acknowledgement__.is_some() { - return Err(serde::de::Error::duplicate_field("acknowledgement")); - } - acknowledgement__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - } - } - Ok(PacketAcknowledgementData { - path: path__.unwrap_or_default(), - acknowledgement: acknowledgement__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v2.PacketAcknowledgementData", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for PacketCommitmentData { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.path.is_empty() { - len += 1; - } - if !self.commitment.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.lightclients.solomachine.v2.PacketCommitmentData", len)?; - if !self.path.is_empty() { - struct_ser - .serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; - } - if !self.commitment.is_empty() { - struct_ser.serialize_field( - "commitment", - pbjson::private::base64::encode(&self.commitment).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PacketCommitmentData { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["path", "commitment"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Path, - Commitment, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "commitment" => Ok(GeneratedField::Commitment), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PacketCommitmentData; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v2.PacketCommitmentData") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut path__ = None; - let mut commitment__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); - } - path__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Commitment => { - if commitment__.is_some() { - return Err(serde::de::Error::duplicate_field("commitment")); - } - commitment__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - } - } - Ok(PacketCommitmentData { - path: path__.unwrap_or_default(), - commitment: commitment__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v2.PacketCommitmentData", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for PacketReceiptAbsenceData { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.path.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData", - len, - )?; - if !self.path.is_empty() { - struct_ser - .serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for PacketReceiptAbsenceData { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["path"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Path, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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 = PacketReceiptAbsenceData; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData") - } - - 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__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - } - } - Ok(PacketReceiptAbsenceData { - path: path__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for SignBytes { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.sequence != 0 { - len += 1; - } - if self.timestamp != 0 { - len += 1; - } - if !self.diversifier.is_empty() { - len += 1; - } - if self.data_type != 0 { - len += 1; - } - if !self.data.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v2.SignBytes", len)?; - if self.sequence != 0 { - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - if self.timestamp != 0 { - struct_ser - .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; - } - if !self.diversifier.is_empty() { - struct_ser.serialize_field("diversifier", &self.diversifier)?; - } - if self.data_type != 0 { - let v = DataType::from_i32(self.data_type).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.data_type)) - })?; - struct_ser.serialize_field("dataType", &v)?; - } - if !self.data.is_empty() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SignBytes { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "sequence", - "timestamp", - "diversifier", - "data_type", - "dataType", - "data", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Sequence, - Timestamp, - Diversifier, - DataType, - Data, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "sequence" => Ok(GeneratedField::Sequence), - "timestamp" => Ok(GeneratedField::Timestamp), - "diversifier" => Ok(GeneratedField::Diversifier), - "dataType" | "data_type" => Ok(GeneratedField::DataType), - "data" => Ok(GeneratedField::Data), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SignBytes; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v2.SignBytes") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sequence__ = None; - let mut timestamp__ = None; - let mut diversifier__ = None; - let mut data_type__ = None; - let mut data__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); - } - timestamp__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Diversifier => { - if diversifier__.is_some() { - return Err(serde::de::Error::duplicate_field("diversifier")); - } - diversifier__ = Some(map.next_value()?); - } - GeneratedField::DataType => { - if data_type__.is_some() { - return Err(serde::de::Error::duplicate_field("dataType")); - } - data_type__ = Some(map.next_value::()? as i32); - } - GeneratedField::Data => { - if data__.is_some() { - return Err(serde::de::Error::duplicate_field("data")); - } - data__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - } - } - Ok(SignBytes { - sequence: sequence__.unwrap_or_default(), - timestamp: timestamp__.unwrap_or_default(), - diversifier: diversifier__.unwrap_or_default(), - data_type: data_type__.unwrap_or_default(), - data: data__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v2.SignBytes", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for SignatureAndData { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.signature.is_empty() { - len += 1; - } - if self.data_type != 0 { - len += 1; - } - if !self.data.is_empty() { - len += 1; - } - if self.timestamp != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v2.SignatureAndData", len)?; - if !self.signature.is_empty() { - struct_ser.serialize_field( - "signature", - pbjson::private::base64::encode(&self.signature).as_str(), - )?; - } - if self.data_type != 0 { - let v = DataType::from_i32(self.data_type).ok_or_else(|| { - serde::ser::Error::custom(format!("Invalid variant {}", self.data_type)) - })?; - struct_ser.serialize_field("dataType", &v)?; - } - if !self.data.is_empty() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - if self.timestamp != 0 { - struct_ser - .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SignatureAndData { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["signature", "data_type", "dataType", "data", "timestamp"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Signature, - DataType, - Data, - Timestamp, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "signature" => Ok(GeneratedField::Signature), - "dataType" | "data_type" => Ok(GeneratedField::DataType), - "data" => Ok(GeneratedField::Data), - "timestamp" => Ok(GeneratedField::Timestamp), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SignatureAndData; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v2.SignatureAndData") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut signature__ = None; - let mut data_type__ = None; - let mut data__ = None; - let mut timestamp__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Signature => { - if signature__.is_some() { - return Err(serde::de::Error::duplicate_field("signature")); - } - signature__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::DataType => { - if data_type__.is_some() { - return Err(serde::de::Error::duplicate_field("dataType")); - } - data_type__ = Some(map.next_value::()? as i32); - } - GeneratedField::Data => { - if data__.is_some() { - return Err(serde::de::Error::duplicate_field("data")); - } - data__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); - } - timestamp__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(SignatureAndData { - signature: signature__.unwrap_or_default(), - data_type: data_type__.unwrap_or_default(), - data: data__.unwrap_or_default(), - timestamp: timestamp__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v2.SignatureAndData", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for TimestampedSignatureData { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.signature_data.is_empty() { - len += 1; - } - if self.timestamp != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.lightclients.solomachine.v2.TimestampedSignatureData", - len, - )?; - if !self.signature_data.is_empty() { - struct_ser.serialize_field( - "signatureData", - pbjson::private::base64::encode(&self.signature_data).as_str(), - )?; - } - if self.timestamp != 0 { - struct_ser - .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TimestampedSignatureData { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["signature_data", "signatureData", "timestamp"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SignatureData, - Timestamp, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "signatureData" | "signature_data" => Ok(GeneratedField::SignatureData), - "timestamp" => Ok(GeneratedField::Timestamp), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TimestampedSignatureData; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct ibc.lightclients.solomachine.v2.TimestampedSignatureData") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut signature_data__ = None; - let mut timestamp__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::SignatureData => { - if signature_data__.is_some() { - return Err(serde::de::Error::duplicate_field("signatureData")); - } - signature_data__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); - } - timestamp__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(TimestampedSignatureData { - signature_data: signature_data__.unwrap_or_default(), - timestamp: timestamp__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v2.TimestampedSignatureData", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/ibc.lightclients.solomachine.v3.rs b/packages/proto/src/gen/ibc.lightclients.solomachine.v3.rs index 029cfa9..6da97e7 100644 --- a/packages/proto/src/gen/ibc.lightclients.solomachine.v3.rs +++ b/packages/proto/src/gen/ibc.lightclients.solomachine.v3.rs @@ -1,6 +1,7 @@ // @generated /// ClientState defines a solo machine client that tracks the current consensus /// state and if the client is frozen. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientState { @@ -23,6 +24,7 @@ impl ::prost::Name for ClientState { /// ConsensusState defines a solo machine consensus state. The sequence of a /// consensus state is contained in the "height" key used in storing the /// consensus state. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConsensusState { @@ -45,6 +47,7 @@ impl ::prost::Name for ConsensusState { } } /// Header defines a solo machine consensus header +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Header { @@ -66,6 +69,7 @@ impl ::prost::Name for Header { } /// Misbehaviour defines misbehaviour for a solo machine which consists /// of a sequence and two signatures over different messages at that sequence. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Misbehaviour { @@ -85,6 +89,7 @@ impl ::prost::Name for Misbehaviour { } /// SignatureAndData contains a signature and the data signed over to create that /// signature. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SignatureAndData { @@ -106,6 +111,7 @@ impl ::prost::Name for SignatureAndData { } /// TimestampedSignatureData contains the signature data and the timestamp of the /// signature. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TimestampedSignatureData { @@ -122,6 +128,7 @@ impl ::prost::Name for TimestampedSignatureData { } } /// SignBytes defines the signed bytes used for signature verification. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SignBytes { @@ -149,6 +156,7 @@ impl ::prost::Name for SignBytes { } } /// HeaderData returns the SignBytes data for update verification. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HeaderData { @@ -495,5 +503,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x08, 0x12, 0x03, 0x61, 0x1d, 0x50, 0x0a, 0x0f, 0x0a, 0x08, 0x04, 0x07, 0x02, 0x01, 0x08, 0xee, 0xfb, 0x03, 0x12, 0x03, 0x61, 0x1e, 0x4f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("ibc.lightclients.solomachine.v3.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/ibc.lightclients.solomachine.v3.serde.rs b/packages/proto/src/gen/ibc.lightclients.solomachine.v3.serde.rs deleted file mode 100644 index 12a05ca..0000000 --- a/packages/proto/src/gen/ibc.lightclients.solomachine.v3.serde.rs +++ /dev/null @@ -1,1164 +0,0 @@ -// @generated -impl serde::Serialize for ClientState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.sequence != 0 { - len += 1; - } - if self.is_frozen { - len += 1; - } - if self.consensus_state.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v3.ClientState", len)?; - if self.sequence != 0 { - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - if self.is_frozen { - struct_ser.serialize_field("isFrozen", &self.is_frozen)?; - } - if let Some(v) = self.consensus_state.as_ref() { - struct_ser.serialize_field("consensusState", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ClientState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "sequence", - "is_frozen", - "isFrozen", - "consensus_state", - "consensusState", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Sequence, - IsFrozen, - ConsensusState, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "sequence" => Ok(GeneratedField::Sequence), - "isFrozen" | "is_frozen" => Ok(GeneratedField::IsFrozen), - "consensusState" | "consensus_state" => { - Ok(GeneratedField::ConsensusState) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ClientState; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v3.ClientState") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sequence__ = None; - let mut is_frozen__ = None; - let mut consensus_state__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::IsFrozen => { - if is_frozen__.is_some() { - return Err(serde::de::Error::duplicate_field("isFrozen")); - } - is_frozen__ = Some(map.next_value()?); - } - GeneratedField::ConsensusState => { - if consensus_state__.is_some() { - return Err(serde::de::Error::duplicate_field("consensusState")); - } - consensus_state__ = map.next_value()?; - } - } - } - Ok(ClientState { - sequence: sequence__.unwrap_or_default(), - is_frozen: is_frozen__.unwrap_or_default(), - consensus_state: consensus_state__, - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v3.ClientState", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ConsensusState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> 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.diversifier.is_empty() { - len += 1; - } - if self.timestamp != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v3.ConsensusState", len)?; - if let Some(v) = self.public_key.as_ref() { - struct_ser.serialize_field("publicKey", v)?; - } - if !self.diversifier.is_empty() { - struct_ser.serialize_field("diversifier", &self.diversifier)?; - } - if self.timestamp != 0 { - struct_ser - .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ConsensusState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["public_key", "publicKey", "diversifier", "timestamp"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PublicKey, - Diversifier, - Timestamp, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(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), - "diversifier" => Ok(GeneratedField::Diversifier), - "timestamp" => Ok(GeneratedField::Timestamp), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ConsensusState; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v3.ConsensusState") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut public_key__ = None; - let mut diversifier__ = None; - let mut timestamp__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::PublicKey => { - if public_key__.is_some() { - return Err(serde::de::Error::duplicate_field("publicKey")); - } - public_key__ = map.next_value()?; - } - GeneratedField::Diversifier => { - if diversifier__.is_some() { - return Err(serde::de::Error::duplicate_field("diversifier")); - } - diversifier__ = Some(map.next_value()?); - } - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); - } - timestamp__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(ConsensusState { - public_key: public_key__, - diversifier: diversifier__.unwrap_or_default(), - timestamp: timestamp__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v3.ConsensusState", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for Header { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.timestamp != 0 { - len += 1; - } - if !self.signature.is_empty() { - len += 1; - } - if self.new_public_key.is_some() { - len += 1; - } - if !self.new_diversifier.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v3.Header", len)?; - if self.timestamp != 0 { - struct_ser - .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; - } - if !self.signature.is_empty() { - struct_ser.serialize_field( - "signature", - pbjson::private::base64::encode(&self.signature).as_str(), - )?; - } - if let Some(v) = self.new_public_key.as_ref() { - struct_ser.serialize_field("newPublicKey", v)?; - } - if !self.new_diversifier.is_empty() { - struct_ser.serialize_field("newDiversifier", &self.new_diversifier)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Header { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "timestamp", - "signature", - "new_public_key", - "newPublicKey", - "new_diversifier", - "newDiversifier", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Timestamp, - Signature, - NewPublicKey, - NewDiversifier, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "timestamp" => Ok(GeneratedField::Timestamp), - "signature" => Ok(GeneratedField::Signature), - "newPublicKey" | "new_public_key" => Ok(GeneratedField::NewPublicKey), - "newDiversifier" | "new_diversifier" => { - Ok(GeneratedField::NewDiversifier) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Header; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v3.Header") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut timestamp__ = None; - let mut signature__ = None; - let mut new_public_key__ = None; - let mut new_diversifier__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); - } - timestamp__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Signature => { - if signature__.is_some() { - return Err(serde::de::Error::duplicate_field("signature")); - } - signature__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::NewPublicKey => { - if new_public_key__.is_some() { - return Err(serde::de::Error::duplicate_field("newPublicKey")); - } - new_public_key__ = map.next_value()?; - } - GeneratedField::NewDiversifier => { - if new_diversifier__.is_some() { - return Err(serde::de::Error::duplicate_field("newDiversifier")); - } - new_diversifier__ = Some(map.next_value()?); - } - } - } - Ok(Header { - timestamp: timestamp__.unwrap_or_default(), - signature: signature__.unwrap_or_default(), - new_public_key: new_public_key__, - new_diversifier: new_diversifier__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v3.Header", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for HeaderData { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.new_pub_key.is_some() { - len += 1; - } - if !self.new_diversifier.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v3.HeaderData", len)?; - if let Some(v) = self.new_pub_key.as_ref() { - struct_ser.serialize_field("newPubKey", v)?; - } - if !self.new_diversifier.is_empty() { - struct_ser.serialize_field("newDiversifier", &self.new_diversifier)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for HeaderData { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "new_pub_key", - "newPubKey", - "new_diversifier", - "newDiversifier", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - NewPubKey, - NewDiversifier, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "newPubKey" | "new_pub_key" => Ok(GeneratedField::NewPubKey), - "newDiversifier" | "new_diversifier" => { - Ok(GeneratedField::NewDiversifier) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = HeaderData; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v3.HeaderData") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut new_pub_key__ = None; - let mut new_diversifier__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::NewPubKey => { - if new_pub_key__.is_some() { - return Err(serde::de::Error::duplicate_field("newPubKey")); - } - new_pub_key__ = map.next_value()?; - } - GeneratedField::NewDiversifier => { - if new_diversifier__.is_some() { - return Err(serde::de::Error::duplicate_field("newDiversifier")); - } - new_diversifier__ = Some(map.next_value()?); - } - } - } - Ok(HeaderData { - new_pub_key: new_pub_key__, - new_diversifier: new_diversifier__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v3.HeaderData", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for Misbehaviour { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.sequence != 0 { - len += 1; - } - if self.signature_one.is_some() { - len += 1; - } - if self.signature_two.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v3.Misbehaviour", len)?; - if self.sequence != 0 { - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - if let Some(v) = self.signature_one.as_ref() { - struct_ser.serialize_field("signatureOne", v)?; - } - if let Some(v) = self.signature_two.as_ref() { - struct_ser.serialize_field("signatureTwo", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Misbehaviour { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "sequence", - "signature_one", - "signatureOne", - "signature_two", - "signatureTwo", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Sequence, - SignatureOne, - SignatureTwo, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "sequence" => Ok(GeneratedField::Sequence), - "signatureOne" | "signature_one" => Ok(GeneratedField::SignatureOne), - "signatureTwo" | "signature_two" => Ok(GeneratedField::SignatureTwo), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Misbehaviour; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v3.Misbehaviour") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sequence__ = None; - let mut signature_one__ = None; - let mut signature_two__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::SignatureOne => { - if signature_one__.is_some() { - return Err(serde::de::Error::duplicate_field("signatureOne")); - } - signature_one__ = map.next_value()?; - } - GeneratedField::SignatureTwo => { - if signature_two__.is_some() { - return Err(serde::de::Error::duplicate_field("signatureTwo")); - } - signature_two__ = map.next_value()?; - } - } - } - Ok(Misbehaviour { - sequence: sequence__.unwrap_or_default(), - signature_one: signature_one__, - signature_two: signature_two__, - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v3.Misbehaviour", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for SignBytes { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.sequence != 0 { - len += 1; - } - if self.timestamp != 0 { - len += 1; - } - if !self.diversifier.is_empty() { - len += 1; - } - if !self.path.is_empty() { - len += 1; - } - if !self.data.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v3.SignBytes", len)?; - if self.sequence != 0 { - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - if self.timestamp != 0 { - struct_ser - .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; - } - if !self.diversifier.is_empty() { - struct_ser.serialize_field("diversifier", &self.diversifier)?; - } - if !self.path.is_empty() { - struct_ser - .serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; - } - if !self.data.is_empty() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SignBytes { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["sequence", "timestamp", "diversifier", "path", "data"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Sequence, - Timestamp, - Diversifier, - Path, - Data, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "sequence" => Ok(GeneratedField::Sequence), - "timestamp" => Ok(GeneratedField::Timestamp), - "diversifier" => Ok(GeneratedField::Diversifier), - "path" => Ok(GeneratedField::Path), - "data" => Ok(GeneratedField::Data), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SignBytes; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v3.SignBytes") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut sequence__ = None; - let mut timestamp__ = None; - let mut diversifier__ = None; - let mut path__ = None; - let mut data__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); - } - timestamp__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Diversifier => { - if diversifier__.is_some() { - return Err(serde::de::Error::duplicate_field("diversifier")); - } - diversifier__ = Some(map.next_value()?); - } - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); - } - path__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Data => { - if data__.is_some() { - return Err(serde::de::Error::duplicate_field("data")); - } - data__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - } - } - Ok(SignBytes { - sequence: sequence__.unwrap_or_default(), - timestamp: timestamp__.unwrap_or_default(), - diversifier: diversifier__.unwrap_or_default(), - path: path__.unwrap_or_default(), - data: data__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v3.SignBytes", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for SignatureAndData { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.signature.is_empty() { - len += 1; - } - if !self.path.is_empty() { - len += 1; - } - if !self.data.is_empty() { - len += 1; - } - if self.timestamp != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v3.SignatureAndData", len)?; - if !self.signature.is_empty() { - struct_ser.serialize_field( - "signature", - pbjson::private::base64::encode(&self.signature).as_str(), - )?; - } - if !self.path.is_empty() { - struct_ser - .serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; - } - if !self.data.is_empty() { - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - if self.timestamp != 0 { - struct_ser - .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SignatureAndData { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["signature", "path", "data", "timestamp"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Signature, - Path, - Data, - Timestamp, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "signature" => Ok(GeneratedField::Signature), - "path" => Ok(GeneratedField::Path), - "data" => Ok(GeneratedField::Data), - "timestamp" => Ok(GeneratedField::Timestamp), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SignatureAndData; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v3.SignatureAndData") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut signature__ = None; - let mut path__ = None; - let mut data__ = None; - let mut timestamp__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Signature => { - if signature__.is_some() { - return Err(serde::de::Error::duplicate_field("signature")); - } - signature__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); - } - path__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Data => { - if data__.is_some() { - return Err(serde::de::Error::duplicate_field("data")); - } - data__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); - } - timestamp__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(SignatureAndData { - signature: signature__.unwrap_or_default(), - path: path__.unwrap_or_default(), - data: data__.unwrap_or_default(), - timestamp: timestamp__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v3.SignatureAndData", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for TimestampedSignatureData { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.signature_data.is_empty() { - len += 1; - } - if self.timestamp != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct( - "ibc.lightclients.solomachine.v3.TimestampedSignatureData", - len, - )?; - if !self.signature_data.is_empty() { - struct_ser.serialize_field( - "signatureData", - pbjson::private::base64::encode(&self.signature_data).as_str(), - )?; - } - if self.timestamp != 0 { - struct_ser - .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for TimestampedSignatureData { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["signature_data", "signatureData", "timestamp"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SignatureData, - Timestamp, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "signatureData" | "signature_data" => Ok(GeneratedField::SignatureData), - "timestamp" => Ok(GeneratedField::Timestamp), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TimestampedSignatureData; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct ibc.lightclients.solomachine.v3.TimestampedSignatureData") - } - - fn visit_map( - self, - mut map: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut signature_data__ = None; - let mut timestamp__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::SignatureData => { - if signature_data__.is_some() { - return Err(serde::de::Error::duplicate_field("signatureData")); - } - signature_data__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); - } - timestamp__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(TimestampedSignatureData { - signature_data: signature_data__.unwrap_or_default(), - timestamp: timestamp__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v3.TimestampedSignatureData", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/packages/proto/src/gen/ibc.lightclients.tendermint.v1.rs b/packages/proto/src/gen/ibc.lightclients.tendermint.v1.rs index a5187b1..d2db9dc 100644 --- a/packages/proto/src/gen/ibc.lightclients.tendermint.v1.rs +++ b/packages/proto/src/gen/ibc.lightclients.tendermint.v1.rs @@ -1,6 +1,7 @@ // @generated /// ClientState from Tendermint tracks the current validator set, latest height, /// and a possible frozen height. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientState { @@ -54,6 +55,7 @@ impl ::prost::Name for ClientState { } } /// ConsensusState defines the consensus state from Tendermint. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConsensusState { @@ -76,6 +78,7 @@ impl ::prost::Name for ConsensusState { } /// Misbehaviour is a wrapper over two conflicting Headers /// that implements Misbehaviour interface expected by ICS-02 +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Misbehaviour { @@ -107,6 +110,7 @@ impl ::prost::Name for Misbehaviour { /// current time in order to correctly verify, and the TrustedValidators must /// hash to TrustedConsensusState.NextValidatorsHash since that is the last /// trusted validator set at the TrustedHeight. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Header { @@ -128,6 +132,7 @@ impl ::prost::Name for Header { } /// Fraction defines the protobuf message type for tmmath.Fraction that only /// supports positive values. +#[derive(::serde::Serialize, ::serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Fraction { @@ -609,5 +614,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[ 0x05, 0x04, 0x04, 0x02, 0x01, 0x03, 0x12, 0x03, 0x71, 0x17, 0x18, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ]; -include!("ibc.lightclients.tendermint.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/packages/proto/src/gen/ibc.lightclients.tendermint.v1.serde.rs b/packages/proto/src/gen/ibc.lightclients.tendermint.v1.serde.rs deleted file mode 100644 index 242cd26..0000000 --- a/packages/proto/src/gen/ibc.lightclients.tendermint.v1.serde.rs +++ /dev/null @@ -1,859 +0,0 @@ -// @generated -impl serde::Serialize for ClientState { - #[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_id.is_empty() { - len += 1; - } - if self.trust_level.is_some() { - len += 1; - } - if self.trusting_period.is_some() { - len += 1; - } - if self.unbonding_period.is_some() { - len += 1; - } - if self.max_clock_drift.is_some() { - len += 1; - } - if self.frozen_height.is_some() { - len += 1; - } - if self.latest_height.is_some() { - len += 1; - } - if !self.proof_specs.is_empty() { - len += 1; - } - if !self.upgrade_path.is_empty() { - len += 1; - } - if self.allow_update_after_expiry { - len += 1; - } - if self.allow_update_after_misbehaviour { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.tendermint.v1.ClientState", len)?; - if !self.chain_id.is_empty() { - struct_ser.serialize_field("chainId", &self.chain_id)?; - } - if let Some(v) = self.trust_level.as_ref() { - struct_ser.serialize_field("trustLevel", v)?; - } - if let Some(v) = self.trusting_period.as_ref() { - struct_ser.serialize_field("trustingPeriod", v)?; - } - if let Some(v) = self.unbonding_period.as_ref() { - struct_ser.serialize_field("unbondingPeriod", v)?; - } - if let Some(v) = self.max_clock_drift.as_ref() { - struct_ser.serialize_field("maxClockDrift", v)?; - } - if let Some(v) = self.frozen_height.as_ref() { - struct_ser.serialize_field("frozenHeight", v)?; - } - if let Some(v) = self.latest_height.as_ref() { - struct_ser.serialize_field("latestHeight", v)?; - } - if !self.proof_specs.is_empty() { - struct_ser.serialize_field("proofSpecs", &self.proof_specs)?; - } - if !self.upgrade_path.is_empty() { - struct_ser.serialize_field("upgradePath", &self.upgrade_path)?; - } - if self.allow_update_after_expiry { - struct_ser - .serialize_field("allowUpdateAfterExpiry", &self.allow_update_after_expiry)?; - } - if self.allow_update_after_misbehaviour { - struct_ser.serialize_field( - "allowUpdateAfterMisbehaviour", - &self.allow_update_after_misbehaviour, - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ClientState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "chain_id", - "chainId", - "trust_level", - "trustLevel", - "trusting_period", - "trustingPeriod", - "unbonding_period", - "unbondingPeriod", - "max_clock_drift", - "maxClockDrift", - "frozen_height", - "frozenHeight", - "latest_height", - "latestHeight", - "proof_specs", - "proofSpecs", - "upgrade_path", - "upgradePath", - "allow_update_after_expiry", - "allowUpdateAfterExpiry", - "allow_update_after_misbehaviour", - "allowUpdateAfterMisbehaviour", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ChainId, - TrustLevel, - TrustingPeriod, - UnbondingPeriod, - MaxClockDrift, - FrozenHeight, - LatestHeight, - ProofSpecs, - UpgradePath, - AllowUpdateAfterExpiry, - AllowUpdateAfterMisbehaviour, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "chainId" | "chain_id" => Ok(GeneratedField::ChainId), - "trustLevel" | "trust_level" => Ok(GeneratedField::TrustLevel), - "trustingPeriod" | "trusting_period" => { - Ok(GeneratedField::TrustingPeriod) - } - "unbondingPeriod" | "unbonding_period" => { - Ok(GeneratedField::UnbondingPeriod) - } - "maxClockDrift" | "max_clock_drift" => { - Ok(GeneratedField::MaxClockDrift) - } - "frozenHeight" | "frozen_height" => Ok(GeneratedField::FrozenHeight), - "latestHeight" | "latest_height" => Ok(GeneratedField::LatestHeight), - "proofSpecs" | "proof_specs" => Ok(GeneratedField::ProofSpecs), - "upgradePath" | "upgrade_path" => Ok(GeneratedField::UpgradePath), - "allowUpdateAfterExpiry" | "allow_update_after_expiry" => { - Ok(GeneratedField::AllowUpdateAfterExpiry) - } - "allowUpdateAfterMisbehaviour" | "allow_update_after_misbehaviour" => { - Ok(GeneratedField::AllowUpdateAfterMisbehaviour) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ClientState; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.tendermint.v1.ClientState") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut chain_id__ = None; - let mut trust_level__ = None; - let mut trusting_period__ = None; - let mut unbonding_period__ = None; - let mut max_clock_drift__ = None; - let mut frozen_height__ = None; - let mut latest_height__ = None; - let mut proof_specs__ = None; - let mut upgrade_path__ = None; - let mut allow_update_after_expiry__ = None; - let mut allow_update_after_misbehaviour__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ChainId => { - if chain_id__.is_some() { - return Err(serde::de::Error::duplicate_field("chainId")); - } - chain_id__ = Some(map.next_value()?); - } - GeneratedField::TrustLevel => { - if trust_level__.is_some() { - return Err(serde::de::Error::duplicate_field("trustLevel")); - } - trust_level__ = map.next_value()?; - } - GeneratedField::TrustingPeriod => { - if trusting_period__.is_some() { - return Err(serde::de::Error::duplicate_field("trustingPeriod")); - } - trusting_period__ = map.next_value()?; - } - GeneratedField::UnbondingPeriod => { - if unbonding_period__.is_some() { - return Err(serde::de::Error::duplicate_field("unbondingPeriod")); - } - unbonding_period__ = map.next_value()?; - } - GeneratedField::MaxClockDrift => { - if max_clock_drift__.is_some() { - return Err(serde::de::Error::duplicate_field("maxClockDrift")); - } - max_clock_drift__ = map.next_value()?; - } - GeneratedField::FrozenHeight => { - if frozen_height__.is_some() { - return Err(serde::de::Error::duplicate_field("frozenHeight")); - } - frozen_height__ = map.next_value()?; - } - GeneratedField::LatestHeight => { - if latest_height__.is_some() { - return Err(serde::de::Error::duplicate_field("latestHeight")); - } - latest_height__ = map.next_value()?; - } - GeneratedField::ProofSpecs => { - if proof_specs__.is_some() { - return Err(serde::de::Error::duplicate_field("proofSpecs")); - } - proof_specs__ = Some(map.next_value()?); - } - GeneratedField::UpgradePath => { - if upgrade_path__.is_some() { - return Err(serde::de::Error::duplicate_field("upgradePath")); - } - upgrade_path__ = Some(map.next_value()?); - } - GeneratedField::AllowUpdateAfterExpiry => { - if allow_update_after_expiry__.is_some() { - return Err(serde::de::Error::duplicate_field( - "allowUpdateAfterExpiry", - )); - } - allow_update_after_expiry__ = Some(map.next_value()?); - } - GeneratedField::AllowUpdateAfterMisbehaviour => { - if allow_update_after_misbehaviour__.is_some() { - return Err(serde::de::Error::duplicate_field( - "allowUpdateAfterMisbehaviour", - )); - } - allow_update_after_misbehaviour__ = Some(map.next_value()?); - } - } - } - Ok(ClientState { - chain_id: chain_id__.unwrap_or_default(), - trust_level: trust_level__, - trusting_period: trusting_period__, - unbonding_period: unbonding_period__, - max_clock_drift: max_clock_drift__, - frozen_height: frozen_height__, - latest_height: latest_height__, - proof_specs: proof_specs__.unwrap_or_default(), - upgrade_path: upgrade_path__.unwrap_or_default(), - allow_update_after_expiry: allow_update_after_expiry__.unwrap_or_default(), - allow_update_after_misbehaviour: allow_update_after_misbehaviour__ - .unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.tendermint.v1.ClientState", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for ConsensusState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.timestamp.is_some() { - len += 1; - } - if self.root.is_some() { - len += 1; - } - if !self.next_validators_hash.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.tendermint.v1.ConsensusState", len)?; - if let Some(v) = self.timestamp.as_ref() { - struct_ser.serialize_field("timestamp", v)?; - } - if let Some(v) = self.root.as_ref() { - struct_ser.serialize_field("root", v)?; - } - if !self.next_validators_hash.is_empty() { - struct_ser.serialize_field( - "nextValidatorsHash", - pbjson::private::base64::encode(&self.next_validators_hash).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for ConsensusState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "timestamp", - "root", - "next_validators_hash", - "nextValidatorsHash", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Timestamp, - Root, - NextValidatorsHash, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "timestamp" => Ok(GeneratedField::Timestamp), - "root" => Ok(GeneratedField::Root), - "nextValidatorsHash" | "next_validators_hash" => { - Ok(GeneratedField::NextValidatorsHash) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ConsensusState; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.tendermint.v1.ConsensusState") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut timestamp__ = None; - let mut root__ = None; - let mut next_validators_hash__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); - } - timestamp__ = map.next_value()?; - } - GeneratedField::Root => { - if root__.is_some() { - return Err(serde::de::Error::duplicate_field("root")); - } - root__ = map.next_value()?; - } - GeneratedField::NextValidatorsHash => { - if next_validators_hash__.is_some() { - return Err(serde::de::Error::duplicate_field( - "nextValidatorsHash", - )); - } - next_validators_hash__ = Some( - map.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - } - } - Ok(ConsensusState { - timestamp: timestamp__, - root: root__, - next_validators_hash: next_validators_hash__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.tendermint.v1.ConsensusState", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for Fraction { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.numerator != 0 { - len += 1; - } - if self.denominator != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.tendermint.v1.Fraction", len)?; - if self.numerator != 0 { - struct_ser - .serialize_field("numerator", ToString::to_string(&self.numerator).as_str())?; - } - if self.denominator != 0 { - struct_ser.serialize_field( - "denominator", - ToString::to_string(&self.denominator).as_str(), - )?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Fraction { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["numerator", "denominator"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Numerator, - Denominator, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "numerator" => Ok(GeneratedField::Numerator), - "denominator" => Ok(GeneratedField::Denominator), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Fraction; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.tendermint.v1.Fraction") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut numerator__ = None; - let mut denominator__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::Numerator => { - if numerator__.is_some() { - return Err(serde::de::Error::duplicate_field("numerator")); - } - numerator__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Denominator => { - if denominator__.is_some() { - return Err(serde::de::Error::duplicate_field("denominator")); - } - denominator__ = Some( - map.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(Fraction { - numerator: numerator__.unwrap_or_default(), - denominator: denominator__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.tendermint.v1.Fraction", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for Header { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.signed_header.is_some() { - len += 1; - } - if self.validator_set.is_some() { - len += 1; - } - if self.trusted_height.is_some() { - len += 1; - } - if self.trusted_validators.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.tendermint.v1.Header", len)?; - if let Some(v) = self.signed_header.as_ref() { - struct_ser.serialize_field("signedHeader", v)?; - } - if let Some(v) = self.validator_set.as_ref() { - struct_ser.serialize_field("validatorSet", v)?; - } - if let Some(v) = self.trusted_height.as_ref() { - struct_ser.serialize_field("trustedHeight", v)?; - } - if let Some(v) = self.trusted_validators.as_ref() { - struct_ser.serialize_field("trustedValidators", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Header { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "signed_header", - "signedHeader", - "validator_set", - "validatorSet", - "trusted_height", - "trustedHeight", - "trusted_validators", - "trustedValidators", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SignedHeader, - ValidatorSet, - TrustedHeight, - TrustedValidators, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "signedHeader" | "signed_header" => Ok(GeneratedField::SignedHeader), - "validatorSet" | "validator_set" => Ok(GeneratedField::ValidatorSet), - "trustedHeight" | "trusted_height" => Ok(GeneratedField::TrustedHeight), - "trustedValidators" | "trusted_validators" => { - Ok(GeneratedField::TrustedValidators) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Header; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.tendermint.v1.Header") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut signed_header__ = None; - let mut validator_set__ = None; - let mut trusted_height__ = None; - let mut trusted_validators__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::SignedHeader => { - if signed_header__.is_some() { - return Err(serde::de::Error::duplicate_field("signedHeader")); - } - signed_header__ = map.next_value()?; - } - GeneratedField::ValidatorSet => { - if validator_set__.is_some() { - return Err(serde::de::Error::duplicate_field("validatorSet")); - } - validator_set__ = map.next_value()?; - } - GeneratedField::TrustedHeight => { - if trusted_height__.is_some() { - return Err(serde::de::Error::duplicate_field("trustedHeight")); - } - trusted_height__ = map.next_value()?; - } - GeneratedField::TrustedValidators => { - if trusted_validators__.is_some() { - return Err(serde::de::Error::duplicate_field("trustedValidators")); - } - trusted_validators__ = map.next_value()?; - } - } - } - Ok(Header { - signed_header: signed_header__, - validator_set: validator_set__, - trusted_height: trusted_height__, - trusted_validators: trusted_validators__, - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.tendermint.v1.Header", - FIELDS, - GeneratedVisitor, - ) - } -} -impl serde::Serialize for Misbehaviour { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_id.is_empty() { - len += 1; - } - if self.header_1.is_some() { - len += 1; - } - if self.header_2.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.tendermint.v1.Misbehaviour", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } - if let Some(v) = self.header_1.as_ref() { - struct_ser.serialize_field("header1", v)?; - } - if let Some(v) = self.header_2.as_ref() { - struct_ser.serialize_field("header2", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Misbehaviour { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "client_id", - "clientId", - "header_1", - "header1", - "header_2", - "header2", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientId, - Header1, - Header2, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "header1" | "header_1" => Ok(GeneratedField::Header1), - "header2" | "header_2" => Ok(GeneratedField::Header2), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Misbehaviour; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.tendermint.v1.Misbehaviour") - } - - fn visit_map(self, mut map: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut client_id__ = None; - let mut header_1__ = None; - let mut header_2__ = None; - while let Some(k) = map.next_key()? { - match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map.next_value()?); - } - GeneratedField::Header1 => { - if header_1__.is_some() { - return Err(serde::de::Error::duplicate_field("header1")); - } - header_1__ = map.next_value()?; - } - GeneratedField::Header2 => { - if header_2__.is_some() { - return Err(serde::de::Error::duplicate_field("header2")); - } - header_2__ = map.next_value()?; - } - } - } - Ok(Misbehaviour { - client_id: client_id__.unwrap_or_default(), - header_1: header_1__, - header_2: header_2__, - }) - } - } - deserializer.deserialize_struct( - "ibc.lightclients.tendermint.v1.Misbehaviour", - FIELDS, - GeneratedVisitor, - ) - } -} diff --git a/proto-build/buf.gen.yaml b/proto-build/buf.gen.yaml index 64ef7d5..323dda9 100644 --- a/proto-build/buf.gen.yaml +++ b/proto-build/buf.gen.yaml @@ -8,10 +8,9 @@ plugins: - extern_path=.google.protobuf.Duration=::pbjson_types::Duration - extern_path=.google.protobuf.Any=::pbjson_types::Any - extern_path=.google.protobuf.FileDescriptorProto=::pbjson_types::FileDescriptorProto + - type_attribute=.=#[derive(::serde::Serialize\, ::serde::Deserialize)] - enable_type_names - file_descriptor_set - - plugin: buf.build/community/neoeinstein-prost-serde:v0.2.3 - out: . - plugin: buf.build/community/neoeinstein-tonic:v0.4.0 out: . opt: diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index 24360e5..bf754f6 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -145,14 +145,6 @@ fn apply_cosmos_staking_patches(out_dir: &str) { patch_file(format!("{out_dir}/cosmos.staking.v1beta1.rs"), REPLACEMENTS) .expect("error patching cosmos.staking.v1beta1.rs"); - - const SERDE_REPLACEMENTS: &[(&str, &str)] = &[("::Validators::", "::Policy::")]; - - patch_file( - format!("{out_dir}/cosmos.staking.v1beta1.serde.rs"), - SERDE_REPLACEMENTS, - ) - .expect("error patching cosmos.staking.v1beta1.serde.rs"); } fn patch_file(path: impl AsRef, replacements: &[(&str, &str)]) -> io::Result<()> {