Merge rust-bitcoin/rust-bitcoin#2702: Automated nightly rustfmt (2024-04-21)

3417c576ed 2024-04-21 automated rustfmt nightly (Fmt Bot)

Pull request description:

  Automated nightly `rustfmt` changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

ACKs for top commit:
  apoelstra:
    ACK 3417c576ed 15-line diff, not too bad

Tree-SHA512: 0e3d58433d05b9f194c11923437adb6ef659bb0f3ea1c1fb37a7b81d0f74f08fea82de192fc0db8dd939b08dbc5050bdb3108c36f3dfc2307b75c4d8d7ee96fc
This commit is contained in:
Andrew Poelstra 2024-04-21 13:08:06 +00:00
commit 019369ebce
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
3 changed files with 9 additions and 5 deletions

View File

@ -61,7 +61,12 @@ fn main() {
let sighash_type = EcdsaSighashType::All; let sighash_type = EcdsaSighashType::All;
let mut sighasher = SighashCache::new(&mut unsigned_tx); let mut sighasher = SighashCache::new(&mut unsigned_tx);
let sighash = sighasher let sighash = sighasher
.p2wpkh_signature_hash(input_index, &dummy_utxo.script_pubkey, DUMMY_UTXO_AMOUNT, sighash_type) .p2wpkh_signature_hash(
input_index,
&dummy_utxo.script_pubkey,
DUMMY_UTXO_AMOUNT,
sighash_type,
)
.expect("failed to create sighash"); .expect("failed to create sighash");
// Sign the sighash using the secp256k1 library (exported by rust-bitcoin). // Sign the sighash using the secp256k1 library (exported by rust-bitcoin).

View File

@ -31,13 +31,12 @@ fn psbt_sign_taproot() {
_secp: &Secp256k1<C>, _secp: &Secp256k1<C>,
) -> Result<Option<PrivateKey>, Self::Error> { ) -> Result<Option<PrivateKey>, Self::Error> {
match key_request { match key_request {
KeyRequest::Bip32((mfp, _)) => { KeyRequest::Bip32((mfp, _)) =>
if mfp == self.mfp { if mfp == self.mfp {
Ok(Some(self.sk)) Ok(Some(self.sk))
} else { } else {
Err(SignError::KeyNotFound) Err(SignError::KeyNotFound)
} },
}
_ => Err(SignError::KeyNotFound), _ => Err(SignError::KeyNotFound),
} }
} }