mirror of https://github.com/zcash/orchard.git
Merge pull request #282 from zcash/clone-unauthorized-bundle
Add `Clone` impls to various structs
This commit is contained in:
commit
4ae32ef98a
|
@ -369,7 +369,7 @@ pub trait InProgressSignatures {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Marker for a bundle in the process of being built.
|
/// Marker for a bundle in the process of being built.
|
||||||
#[derive(Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct InProgress<P, S: InProgressSignatures> {
|
pub struct InProgress<P, S: InProgressSignatures> {
|
||||||
proof: P,
|
proof: P,
|
||||||
sigs: S,
|
sigs: S,
|
||||||
|
@ -382,7 +382,7 @@ impl<P, S: InProgressSignatures> Authorization for InProgress<P, S> {
|
||||||
/// Marker for a bundle without a proof.
|
/// Marker for a bundle without a proof.
|
||||||
///
|
///
|
||||||
/// This struct contains the private data needed to create a [`Proof`] for a [`Bundle`].
|
/// This struct contains the private data needed to create a [`Proof`] for a [`Bundle`].
|
||||||
#[derive(Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct Unproven {
|
pub struct Unproven {
|
||||||
circuits: Vec<Circuit>,
|
circuits: Vec<Circuit>,
|
||||||
}
|
}
|
||||||
|
@ -426,7 +426,7 @@ impl<S: InProgressSignatures, V> Bundle<InProgress<Unproven, S>, V> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The parts needed to sign an [`Action`].
|
/// The parts needed to sign an [`Action`].
|
||||||
#[derive(Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct SigningParts {
|
pub struct SigningParts {
|
||||||
/// The spend validating key for this action. Used to match spend authorizing keys to
|
/// The spend validating key for this action. Used to match spend authorizing keys to
|
||||||
/// actions they can create signatures for.
|
/// actions they can create signatures for.
|
||||||
|
@ -436,7 +436,7 @@ pub struct SigningParts {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Marker for an unauthorized bundle with no signatures.
|
/// Marker for an unauthorized bundle with no signatures.
|
||||||
#[derive(Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct Unauthorized {
|
pub struct Unauthorized {
|
||||||
bsk: redpallas::SigningKey<Binding>,
|
bsk: redpallas::SigningKey<Binding>,
|
||||||
}
|
}
|
||||||
|
@ -446,7 +446,7 @@ impl InProgressSignatures for Unauthorized {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Container for metadata needed to sign an [`Action`].
|
/// Container for metadata needed to sign an [`Action`].
|
||||||
#[derive(Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct SigningMetadata {
|
pub struct SigningMetadata {
|
||||||
/// If this action is spending a dummy note, this field holds that note's spend
|
/// If this action is spending a dummy note, this field holds that note's spend
|
||||||
/// authorizing key.
|
/// authorizing key.
|
||||||
|
|
|
@ -92,7 +92,7 @@ pub struct Config {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The Orchard Action circuit.
|
/// The Orchard Action circuit.
|
||||||
#[derive(Debug, Default)]
|
#[derive(Clone, Debug, Default)]
|
||||||
pub struct Circuit {
|
pub struct Circuit {
|
||||||
pub(crate) path: Option<[MerkleHashOrchard; MERKLE_DEPTH_ORCHARD]>,
|
pub(crate) path: Option<[MerkleHashOrchard; MERKLE_DEPTH_ORCHARD]>,
|
||||||
pub(crate) pos: Option<u32>,
|
pub(crate) pos: Option<u32>,
|
||||||
|
|
|
@ -104,7 +104,7 @@ impl SpendingKey {
|
||||||
/// Defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components][orchardkeycomponents].
|
/// Defined in [Zcash Protocol Spec § 4.2.3: Orchard Key Components][orchardkeycomponents].
|
||||||
///
|
///
|
||||||
/// [orchardkeycomponents]: https://zips.z.cash/protocol/nu5.pdf#orchardkeycomponents
|
/// [orchardkeycomponents]: https://zips.z.cash/protocol/nu5.pdf#orchardkeycomponents
|
||||||
#[derive(Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct SpendAuthorizingKey(redpallas::SigningKey<SpendAuth>);
|
pub struct SpendAuthorizingKey(redpallas::SigningKey<SpendAuth>);
|
||||||
|
|
||||||
impl SpendAuthorizingKey {
|
impl SpendAuthorizingKey {
|
||||||
|
|
|
@ -12,7 +12,7 @@ use crate::{
|
||||||
};
|
};
|
||||||
use halo2_gadgets::primitives::sinsemilla;
|
use halo2_gadgets::primitives::sinsemilla;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub(crate) struct NoteCommitTrapdoor(pub(super) pallas::Scalar);
|
pub(crate) struct NoteCommitTrapdoor(pub(super) pallas::Scalar);
|
||||||
|
|
||||||
impl NoteCommitTrapdoor {
|
impl NoteCommitTrapdoor {
|
||||||
|
|
|
@ -23,7 +23,7 @@ pub type Binding = reddsa::orchard::Binding;
|
||||||
impl SigType for Binding {}
|
impl SigType for Binding {}
|
||||||
|
|
||||||
/// A RedPallas signing key.
|
/// A RedPallas signing key.
|
||||||
#[derive(Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct SigningKey<T: SigType>(reddsa::SigningKey<T>);
|
pub struct SigningKey<T: SigType>(reddsa::SigningKey<T>);
|
||||||
|
|
||||||
impl<T: SigType> From<SigningKey<T>> for [u8; 32] {
|
impl<T: SigType> From<SigningKey<T>> for [u8; 32] {
|
||||||
|
|
Loading…
Reference in New Issue