mirror of
https://github.com/hinto-janai/cuprate.git
synced 2024-11-16 15:58:14 +00:00
output enum
This commit is contained in:
parent
2643902ecc
commit
ea80e666b2
2 changed files with 14 additions and 10 deletions
|
@ -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,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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)]
|
||||||
|
|
Loading…
Reference in a new issue