Preemptively box encrypted signature to avoid size difference in enum

pull/177/head
Franck Royer 4 years ago
parent fd084b764d
commit 69363e43a3
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4

@ -76,7 +76,7 @@ impl From<&AliceState> for Alice {
encrypted_signature,
} => Alice::EncSigLearned {
state3: state3.as_ref().clone(),
encrypted_signature: encrypted_signature.clone(),
encrypted_signature: *encrypted_signature.clone(),
},
AliceState::BtcRedeemed => Alice::Done(AliceEndState::BtcRedeemed),
AliceState::BtcCancelled { state3, .. } => Alice::BtcCancelled(state3.as_ref().clone()),
@ -135,7 +135,7 @@ impl From<Alice> for AliceState {
encrypted_signature,
} => AliceState::EncSigLearned {
state3: Box::new(state),
encrypted_signature,
encrypted_signature: Box::new(encrypted_signature),
},
Alice::CancelTimelockExpired(state3) => AliceState::CancelTimelockExpired {
state3: Box::new(state3),

@ -41,7 +41,7 @@ pub enum AliceState {
state3: Box<State3>,
},
EncSigLearned {
encrypted_signature: bitcoin::EncryptedSignature,
encrypted_signature: Box<bitcoin::EncryptedSignature>,
state3: Box<State3>,
},
BtcRedeemed,

@ -202,7 +202,7 @@ async fn run_until_internal(
Either::Left(_) => AliceState::CancelTimelockExpired { state3 },
Either::Right((enc_sig, _)) => AliceState::EncSigLearned {
state3,
encrypted_signature: enc_sig?,
encrypted_signature: Box::new(enc_sig?),
},
}
}
@ -231,7 +231,7 @@ async fn run_until_internal(
let state = match state3.expired_timelocks(bitcoin_wallet.as_ref()).await? {
ExpiredTimelocks::None => {
match build_bitcoin_redeem_transaction(
encrypted_signature,
*encrypted_signature,
&state3.tx_lock,
state3.a.clone(),
state3.s_a,

Loading…
Cancel
Save