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.
This commit is contained in:
parent
871f4398b9
commit
386ad93253
|
@ -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<C: Verification>(&self, secp: &Secp256k1<C>, internal_key: UntweakedPublicKey) -> ScriptBuf {
|
||||
fn to_p2tr<C: Verification>(
|
||||
&self,
|
||||
secp: &Secp256k1<C>,
|
||||
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<C: Verification>(secp: &Secp256k1<C>, internal_key: UntweakedPublicKey, merkle_root: Option<TapNodeHash>) -> Self {
|
||||
fn new_p2tr<C: Verification>(
|
||||
secp: &Secp256k1<C>,
|
||||
internal_key: UntweakedPublicKey,
|
||||
merkle_root: Option<TapNodeHash>,
|
||||
) -> 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())
|
||||
|
|
Loading…
Reference in New Issue