2024-04-21 automated rustfmt nightly

This commit is contained in:
Fmt Bot 2024-04-21 01:03:30 +00:00 committed by github-actions[bot]
parent 76a5909029
commit 3417c576ed
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

@ -130,7 +130,7 @@ pub static SIGNET: Params = Params::SIGNET;
/// The regtest parameters. /// The regtest parameters.
pub static REGTEST: Params = Params::REGTEST; pub static REGTEST: Params = Params::REGTEST;
#[allow(deprecated)] // For `pow_limit`. #[allow(deprecated)] // For `pow_limit`.
impl Params { impl Params {
/// The mainnet parameters (alias for `Params::MAINNET`). /// The mainnet parameters (alias for `Params::MAINNET`).
pub const BITCOIN: Params = Params::MAINNET; pub const BITCOIN: Params = Params::MAINNET;

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),
} }
} }