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.
|
||||
#[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,
|
||||
}
|
||||
|
||||
|
|
|
@ -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<String>,
|
||||
#[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<TaggedKey>,
|
||||
impl Default for Target {
|
||||
fn default() -> Self {
|
||||
Self::Key {
|
||||
key: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
|
|
Loading…
Reference in a new issue