Make the `Bundle` type implement `Clone`

This is required for proptest generation that handles shrinking
correctly in librustzcash.
This commit is contained in:
Kris Nuttycombe 2021-05-13 15:35:44 -06:00
parent 3117187280
commit 800e540875
4 changed files with 6 additions and 6 deletions

View File

@ -18,7 +18,7 @@ use crate::{
///
/// Internally, this may both consume a note and create a note, or it may do only one of
/// the two. TODO: Determine which is more efficient (circuit size vs bundle size).
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct Action<A> {
/// The nullifier of the note being spent.
nf: Nullifier,
@ -173,7 +173,7 @@ pub trait Authorization {
}
/// A bundle of actions to be applied to the ledger.
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct Bundle<T: Authorization, V> {
/// The list of actions that make up this bundle.
actions: NonEmpty<Action<T::SpendAuth>>,
@ -301,7 +301,7 @@ impl<T: Authorization, V> Bundle<T, V> {
}
/// Authorizing data for a bundle of actions, ready to be committed to the ledger.
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct Authorized {
proof: Proof,
binding_signature: redpallas::Signature<Binding>,

View File

@ -116,7 +116,7 @@ impl Instance {
/// A proof of the validity of an Orchard [`Bundle`].
///
/// [`Bundle`]: crate::bundle::Bundle
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct Proof(Vec<u8>);
impl AsRef<[u8]> for Proof {

View File

@ -135,7 +135,7 @@ impl Note {
}
/// An encrypted note.
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct TransmittedNoteCiphertext {
/// The serialization of the ephemeral public key
pub epk_bytes: [u8; 32],

View File

@ -93,7 +93,7 @@ impl VerificationKey<SpendAuth> {
}
/// A RedPallas signature.
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct Signature<T: SigType>(reddsa::Signature<T>);
impl<T: SigType> From<[u8; 64]> for Signature<T> {