From 386ad93253b7ee7421593b29c3a4129e9fcb8b86 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 16 Jul 2024 08:35:04 +1000 Subject: [PATCH] Manually format function parameters Now that the `define_extension_trait` can handle function parameters on individual lines revert the manual formatting that was introduced in PR #2955. Refactor only, no logic changes. --- bitcoin/src/address/script_pubkey.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bitcoin/src/address/script_pubkey.rs b/bitcoin/src/address/script_pubkey.rs index ff38e080b..de10c5f61 100644 --- a/bitcoin/src/address/script_pubkey.rs +++ b/bitcoin/src/address/script_pubkey.rs @@ -48,7 +48,11 @@ define_extension_trait! { /// Computes P2TR output with a given internal key and a single script spending path equal to /// the current script, assuming that the script is a Tapscript. - fn to_p2tr(&self, secp: &Secp256k1, internal_key: UntweakedPublicKey) -> ScriptBuf { + fn to_p2tr( + &self, + secp: &Secp256k1, + internal_key: UntweakedPublicKey, + ) -> ScriptBuf { let leaf_hash = self.tapscript_leaf_hash(); let merkle_root = TapNodeHash::from(leaf_hash); ScriptBuf::new_p2tr(secp, internal_key, Some(merkle_root)) @@ -150,7 +154,11 @@ define_extension_trait! { /// Generates P2TR for script spending path using an internal public key and some optional /// script tree Merkle root. - fn new_p2tr(secp: &Secp256k1, internal_key: UntweakedPublicKey, merkle_root: Option) -> Self { + fn new_p2tr( + secp: &Secp256k1, + internal_key: UntweakedPublicKey, + merkle_root: Option, + ) -> Self { let (output_key, _) = internal_key.tap_tweak(secp, merkle_root); // output key is 32 bytes long, so it's safe to use `new_witness_program_unchecked` (Segwitv1) new_witness_program_unchecked(WitnessVersion::V1, output_key.serialize())