diff --git a/examples/plan_spend.rs b/examples/plan_spend.rs index a59d7f1ad..1494bd08d 100644 --- a/examples/plan_spend.rs +++ b/examples/plan_spend.rs @@ -142,7 +142,7 @@ fn main() { .update_with_descriptor_unchecked(&bridge_descriptor) .unwrap(); input.witness_utxo = Some(witness_utxo.clone()); - + // Push the PSBT Input and declare an PSBT Output Structure psbt.inputs.push(input); psbt.outputs.push(psbt::Output::default()); diff --git a/examples/psbt_sign_finalize.rs b/examples/psbt_sign_finalize.rs index fc801e31e..cb7f0dfaf 100644 --- a/examples/psbt_sign_finalize.rs +++ b/examples/psbt_sign_finalize.rs @@ -123,7 +123,7 @@ fn main() { // Obtain the result of the plan based on provided assets let result = bridge_descriptor.clone().get_plan(&assets); - + // Creating a PSBT Input let mut input = psbt::Input::default(); result.unwrap().update_psbt_input(&mut input); @@ -131,7 +131,7 @@ fn main() { .update_with_descriptor_unchecked(&bridge_descriptor) .unwrap(); input.witness_utxo = Some(witness_utxo.clone()); - + // Push the PSBT Input and declare an PSBT Output Structure psbt.inputs.push(input); psbt.outputs.push(psbt::Output::default()); diff --git a/src/miniscript/satisfy.rs b/src/miniscript/satisfy.rs index 4c1f2c795..88fcbc92d 100644 --- a/src/miniscript/satisfy.rs +++ b/src/miniscript/satisfy.rs @@ -474,12 +474,12 @@ impl Placeholder { pub fn satisfy_self>(&self, sat: &Sat) -> Option> { match self { Placeholder::Pubkey(pk, size) => { - if *size==34 as usize { + if *size == 34 as usize { return Some(pk.to_public_key().to_bytes()); - }else{ - return Some(pk.to_x_only_pubkey().serialize().to_vec()) + } else { + return Some(pk.to_x_only_pubkey().serialize().to_vec()); } - },//length = 32 for XOnly + } //length = 32 for XOnly Placeholder::Hash256Preimage(h) => sat.lookup_hash256(h).map(|p| p.to_vec()), Placeholder::Sha256Preimage(h) => sat.lookup_sha256(h).map(|p| p.to_vec()), Placeholder::Hash160Preimage(h) => sat.lookup_hash160(h).map(|p| p.to_vec()), diff --git a/src/psbt/finalizer.rs b/src/psbt/finalizer.rs index b81ac3cf0..eea792191 100644 --- a/src/psbt/finalizer.rs +++ b/src/psbt/finalizer.rs @@ -16,11 +16,12 @@ use bitcoin::taproot::LeafVersion; use bitcoin::{PublicKey, Script, ScriptBuf, TxOut, Witness}; use super::{sanity_check, Error, InputError, Psbt, PsbtInputSatisfier}; +use crate::prelude::*; use crate::util::witness_size; use crate::{ - interpreter, BareCtx, Descriptor, ExtParams, Legacy, Miniscript, Satisfier, Segwitv0, Tap, + interpreter, BareCtx, Descriptor, ExtParams, Legacy, Miniscript, Satisfier, Segwitv0, SigType, + Tap, ToPublicKey, }; -use crate::{prelude::*, SigType, ToPublicKey}; // Satisfy the taproot descriptor. It is not possible to infer the complete // descriptor from psbt because the information about all the scripts might not