diff --git a/types/src/json/block.rs b/types/src/json/block.rs index 322a342..3c3343c 100644 --- a/types/src/json/block.rs +++ b/types/src/json/block.rs @@ -45,7 +45,7 @@ pub enum MinerTransaction { /// This field is flattened. #[serde(flatten)] prefix: MinerTransactionPrefix, - rct_signatures: MinerTransactionRctSignature, + rct_signatures: MinerTransactionRctSignatures, }, } @@ -60,7 +60,7 @@ impl Default for MinerTransaction { #[derive(Copy, Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] -pub struct MinerTransactionRctSignature { +pub struct MinerTransactionRctSignatures { pub r#type: u8, } diff --git a/types/src/json/output.rs b/types/src/json/output.rs index 5217497..6cacc27 100644 --- a/types/src/json/output.rs +++ b/types/src/json/output.rs @@ -14,16 +14,20 @@ pub struct Output { pub target: Target, } -#[derive(Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] -pub struct Target { - /// Should be [`None`] if [`Self::tagged_key`] is [`Some`] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub key: Option, +#[serde(untagged)] +pub enum Target { + Key { key: String }, + TaggedKey { tagged_key: TaggedKey }, +} - /// Should be [`None`] if [`Self::key`] is [`Some`] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tagged_key: Option, +impl Default for Target { + fn default() -> Self { + Self::Key { + key: Default::default(), + } + } } #[derive(Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]