Browse Source

PR feedback and fmt

compile-for-aarch64
Philipp Hoenisch 3 years ago
parent
commit
9b755b9a59
No known key found for this signature in database GPG Key ID: E5F8E74C672BC666
  1. 22
      daemon/src/setup_contract.rs
  2. 1
      daemon/src/wire.rs

22
daemon/src/setup_contract.rs

@ -8,7 +8,7 @@ use crate::{model, oracle, payout_curve};
use anyhow::{Context, Result};
use bdk::bitcoin::secp256k1::{schnorrsig, Signature, SECP256K1};
use bdk::bitcoin::util::psbt::PartiallySignedTransaction;
use bdk::bitcoin::{Amount, PublicKey, Transaction, TxIn};
use bdk::bitcoin::{Amount, PublicKey, Transaction};
use bdk::descriptor::Descriptor;
use bdk::miniscript::DescriptorTrait;
use cfd_protocol::secp256k1_zkp::EcdsaAdaptorSignature;
@ -289,23 +289,11 @@ pub async fn roll_over(
)]);
// unsign lock tx because PartiallySignedTransaction needs an unsigned tx
let unsigned_lock_tx = Transaction {
version: 0,
lock_time: dlc.lock.0.lock_time,
input: dlc
.lock
.0
let mut unsigned_lock_tx = dlc.lock.0.clone();
unsigned_lock_tx
.input
.iter()
.map(|txin| TxIn {
previous_output: txin.previous_output,
script_sig: txin.script_sig.clone(),
sequence: txin.sequence,
witness: vec![],
})
.collect(),
output: dlc.lock.0.output.clone(),
};
.iter_mut()
.for_each(|input| input.witness.clear());
let lock_tx = PartiallySignedTransaction::from_unsigned_tx(unsigned_lock_tx)?;
let other_punish_params = PunishParams {

1
daemon/src/wire.rs

@ -328,6 +328,7 @@ pub struct RollOverMsg1 {
pub cets: HashMap<String, Vec<(RangeInclusive<u64>, EcdsaAdaptorSignature)>>,
pub refund: Signature,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct RollOverMsg2 {
pub revocation_sk: SecretKey,

Loading…
Cancel
Save