Skip to content

Commit

Permalink
format whitespaces
Browse files Browse the repository at this point in the history
Signed-off-by: Harshil Jani <harshiljani2002@gmail.com>
  • Loading branch information
Harshil-Jani committed Jul 3, 2023
1 parent 0ffd4a2 commit 980664b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/plan_spend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions examples/psbt_sign_finalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ 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);
input
.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());
Expand Down
8 changes: 4 additions & 4 deletions src/miniscript/satisfy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,12 +474,12 @@ impl<Pk: MiniscriptKey + ToPublicKey> Placeholder<Pk> {
pub fn satisfy_self<Sat: Satisfier<Pk>>(&self, sat: &Sat) -> Option<Vec<u8>> {
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()),
Expand Down
5 changes: 3 additions & 2 deletions src/psbt/finalizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 980664b

Please sign in to comment.