Derive Clone/ on initial states and messages

This commit is contained in:
Tobin C. Harding 2020-10-21 15:02:37 +11:00
parent 08ec776daa
commit f22729c5da
4 changed files with 12 additions and 12 deletions

View File

@ -129,7 +129,7 @@ impl State {
} }
} }
#[derive(Debug)] #[derive(Clone, Debug)]
pub struct State0 { pub struct State0 {
a: bitcoin::SecretKey, a: bitcoin::SecretKey,
s_a: cross_curve_dleq::Scalar, s_a: cross_curve_dleq::Scalar,
@ -215,7 +215,7 @@ impl State0 {
} }
} }
#[derive(Debug)] #[derive(Clone, Debug)]
pub struct State1 { pub struct State1 {
a: bitcoin::SecretKey, a: bitcoin::SecretKey,
B: bitcoin::PublicKey, B: bitcoin::PublicKey,

View File

@ -11,7 +11,7 @@ pub enum Message {
Message2(Message2), Message2(Message2),
} }
#[derive(Debug)] #[derive(Clone, Debug)]
pub struct Message0 { pub struct Message0 {
pub(crate) A: bitcoin::PublicKey, pub(crate) A: bitcoin::PublicKey,
pub(crate) S_a_monero: monero::PublicKey, pub(crate) S_a_monero: monero::PublicKey,
@ -22,13 +22,13 @@ pub struct Message0 {
pub(crate) punish_address: bitcoin::Address, pub(crate) punish_address: bitcoin::Address,
} }
#[derive(Debug)] #[derive(Clone, Debug)]
pub struct Message1 { pub struct Message1 {
pub(crate) tx_cancel_sig: Signature, pub(crate) tx_cancel_sig: Signature,
pub(crate) tx_refund_encsig: EncryptedSignature, pub(crate) tx_refund_encsig: EncryptedSignature,
} }
#[derive(Debug)] #[derive(Clone, Debug)]
pub struct Message2 { pub struct Message2 {
pub(crate) tx_lock_proof: monero::TransferProof, pub(crate) tx_lock_proof: monero::TransferProof,
} }

View File

@ -102,7 +102,7 @@ impl_from_child_enum!(State3, State);
impl_from_child_enum!(State4, State); impl_from_child_enum!(State4, State);
impl_from_child_enum!(State5, State); impl_from_child_enum!(State5, State);
#[derive(Debug)] #[derive(Clone, Debug)]
pub struct State0 { pub struct State0 {
b: bitcoin::SecretKey, b: bitcoin::SecretKey,
s_b: cross_curve_dleq::Scalar, s_b: cross_curve_dleq::Scalar,
@ -190,7 +190,7 @@ impl State0 {
} }
} }
#[derive(Debug)] #[derive(Clone, Debug)]
pub struct State1 { pub struct State1 {
A: bitcoin::PublicKey, A: bitcoin::PublicKey,
b: bitcoin::SecretKey, b: bitcoin::SecretKey,

View File

@ -3,7 +3,7 @@ use anyhow::Result;
use ecdsa_fun::{adaptor::EncryptedSignature, Signature}; use ecdsa_fun::{adaptor::EncryptedSignature, Signature};
use std::convert::TryFrom; use std::convert::TryFrom;
#[derive(Debug)] #[derive(Clone, Debug)]
pub enum Message { pub enum Message {
Message0(Message0), Message0(Message0),
Message1(Message1), Message1(Message1),
@ -11,7 +11,7 @@ pub enum Message {
Message3(Message3), Message3(Message3),
} }
#[derive(Debug)] #[derive(Clone, Debug)]
pub struct Message0 { pub struct Message0 {
pub(crate) B: bitcoin::PublicKey, pub(crate) B: bitcoin::PublicKey,
pub(crate) S_b_monero: monero::PublicKey, pub(crate) S_b_monero: monero::PublicKey,
@ -21,18 +21,18 @@ pub struct Message0 {
pub(crate) refund_address: bitcoin::Address, pub(crate) refund_address: bitcoin::Address,
} }
#[derive(Debug)] #[derive(Clone, Debug)]
pub struct Message1 { pub struct Message1 {
pub(crate) tx_lock: bitcoin::TxLock, pub(crate) tx_lock: bitcoin::TxLock,
} }
#[derive(Debug)] #[derive(Clone, Debug)]
pub struct Message2 { pub struct Message2 {
pub(crate) tx_punish_sig: Signature, pub(crate) tx_punish_sig: Signature,
pub(crate) tx_cancel_sig: Signature, pub(crate) tx_cancel_sig: Signature,
} }
#[derive(Debug)] #[derive(Clone, Debug)]
pub struct Message3 { pub struct Message3 {
pub(crate) tx_redeem_encsig: EncryptedSignature, pub(crate) tx_redeem_encsig: EncryptedSignature,
} }