output enum
Some checks are pending
Audit / audit (push) Waiting to run
Deny / audit (push) Waiting to run

This commit is contained in:
hinto.janai 2024-09-25 21:27:50 -04:00
parent 2643902ecc
commit ea80e666b2
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
2 changed files with 14 additions and 10 deletions

View file

@ -45,7 +45,7 @@ pub enum MinerTransaction {
/// This field is flattened. /// This field is flattened.
#[serde(flatten)] #[serde(flatten)]
prefix: MinerTransactionPrefix, 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)] #[derive(Copy, Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct MinerTransactionRctSignature { pub struct MinerTransactionRctSignatures {
pub r#type: u8, pub r#type: u8,
} }

View file

@ -14,16 +14,20 @@ pub struct Output {
pub target: Target, 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))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Target { #[serde(untagged)]
/// Should be [`None`] if [`Self::tagged_key`] is [`Some`] pub enum Target {
#[serde(default, skip_serializing_if = "Option::is_none")] Key { key: String },
pub key: Option<String>, TaggedKey { tagged_key: TaggedKey },
}
/// Should be [`None`] if [`Self::key`] is [`Some`] impl Default for Target {
#[serde(default, skip_serializing_if = "Option::is_none")] fn default() -> Self {
pub tagged_key: Option<TaggedKey>, Self::Key {
key: Default::default(),
}
}
} }
#[derive(Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]