Skip to content

Commit 3ddad52

Browse files
evanlinjinclaude
andcommitted
bitcoind-tests: Run cargo fmt
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 08f7b62 commit 3ddad52

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

bitcoind-tests/tests/setup/test_util.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ use bitcoin::hex::DisplayHex;
2525
use bitcoin::secp256k1;
2626
use miniscript::descriptor::{SinglePub, SinglePubKey};
2727
use miniscript::{
28-
bitcoin, hash256, Descriptor, DescriptorPublicKey, Error, Miniscript, ScriptContext,
29-
Translator,
28+
bitcoin, hash256, Descriptor, DescriptorPublicKey, Error, Miniscript, ScriptContext, Translator,
3029
};
3130
use rand::RngCore;
3231
use secp256k1::XOnlyPublicKey;

bitcoind-tests/tests/test_desc.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,19 @@ pub fn test_desc_satisfy(
168168

169169
if let Some(internal_keypair) = internal_keypair {
170170
// ---------------------- Tr key spend --------------------
171-
let internal_keypair = internal_keypair
172-
.tap_tweak(&secp, tr.spend_info().merkle_root());
171+
let internal_keypair =
172+
internal_keypair.tap_tweak(&secp, tr.spend_info().merkle_root());
173173
let sighash_msg = sighash_cache
174174
.taproot_key_spend_signature_hash(0, &prevouts, sighash_type)
175175
.unwrap();
176176
let msg = secp256k1::Message::from_digest(sighash_msg.to_byte_array());
177177
let mut aux_rand = [0u8; 32];
178178
rand::thread_rng().fill_bytes(&mut aux_rand);
179-
let schnorr_sig =
180-
secp.sign_schnorr_with_aux_rand(&msg, &internal_keypair.to_keypair(), &aux_rand);
179+
let schnorr_sig = secp.sign_schnorr_with_aux_rand(
180+
&msg,
181+
&internal_keypair.to_keypair(),
182+
&aux_rand,
183+
);
181184
psbt.inputs[0].tap_key_sig =
182185
Some(taproot::Signature { signature: schnorr_sig, sighash_type });
183186
} else {
@@ -187,7 +190,8 @@ pub fn test_desc_satisfy(
187190
let x_only_keypairs_reqd: Vec<(secp256k1::Keypair, TapLeafHash)> = tr
188191
.leaves()
189192
.flat_map(|leaf| {
190-
let leaf_hash = TapLeafHash::from_script(&leaf.compute_script(), LeafVersion::TapScript);
193+
let leaf_hash =
194+
TapLeafHash::from_script(&leaf.compute_script(), LeafVersion::TapScript);
191195
leaf.miniscript().iter_pk().filter_map(move |pk| {
192196
let i = x_only_pks.iter().position(|&x| x.to_public_key() == pk);
193197
i.map(|idx| (xonly_keypairs[idx], leaf_hash))

0 commit comments

Comments
 (0)