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: ACK3417c576ed
15-line diff, not too bad Tree-SHA512: 0e3d58433d05b9f194c11923437adb6ef659bb0f3ea1c1fb37a7b81d0f74f08fea82de192fc0db8dd939b08dbc5050bdb3108c36f3dfc2307b75c4d8d7ee96fc
This commit is contained in:
commit
019369ebce
|
@ -61,7 +61,12 @@ fn main() {
|
|||
let sighash_type = EcdsaSighashType::All;
|
||||
let mut sighasher = SighashCache::new(&mut unsigned_tx);
|
||||
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");
|
||||
|
||||
// Sign the sighash using the secp256k1 library (exported by rust-bitcoin).
|
||||
|
|
|
@ -130,7 +130,7 @@ pub static SIGNET: Params = Params::SIGNET;
|
|||
/// The regtest parameters.
|
||||
pub static REGTEST: Params = Params::REGTEST;
|
||||
|
||||
#[allow(deprecated)] // For `pow_limit`.
|
||||
#[allow(deprecated)] // For `pow_limit`.
|
||||
impl Params {
|
||||
/// The mainnet parameters (alias for `Params::MAINNET`).
|
||||
pub const BITCOIN: Params = Params::MAINNET;
|
||||
|
|
|
@ -31,13 +31,12 @@ fn psbt_sign_taproot() {
|
|||
_secp: &Secp256k1<C>,
|
||||
) -> Result<Option<PrivateKey>, Self::Error> {
|
||||
match key_request {
|
||||
KeyRequest::Bip32((mfp, _)) => {
|
||||
KeyRequest::Bip32((mfp, _)) =>
|
||||
if mfp == self.mfp {
|
||||
Ok(Some(self.sk))
|
||||
} else {
|
||||
Err(SignError::KeyNotFound)
|
||||
}
|
||||
}
|
||||
},
|
||||
_ => Err(SignError::KeyNotFound),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue