Merge rust-bitcoin/rust-bitcoin#3396: Automated nightly rustfmt (2024-09-22)

2009763ae5 2024-09-22 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 2009763ae5 successfully ran local tests

Tree-SHA512: 3e80d6d3b72eb4ce26dfeac7ced916c7f9b76368bdbd4273d5d558fc9da89f16a24e2d8e99cdd4a528cf73514affd9fc8fb454543cc124b90567418824dfebeb
This commit is contained in:
merge-script 2024-09-22 16:00:19 +00:00
commit 5690a64667
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
4 changed files with 10 additions and 13 deletions

View File

@ -1412,21 +1412,18 @@ impl InputWeightPrediction {
#[cfg(feature = "arbitrary")]
impl<'a> Arbitrary<'a> for OutPoint {
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
Ok(OutPoint{
txid: Txid::arbitrary(u)?,
vout: u32::arbitrary(u)?
})
Ok(OutPoint { txid: Txid::arbitrary(u)?, vout: u32::arbitrary(u)? })
}
}
#[cfg(feature = "arbitrary")]
impl<'a> Arbitrary<'a> for TxIn {
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
Ok(TxIn{
Ok(TxIn {
previous_output: OutPoint::arbitrary(u)?,
script_sig: ScriptBuf::arbitrary(u)?,
sequence: Sequence::arbitrary(u)?,
witness: Witness::arbitrary(u)?
witness: Witness::arbitrary(u)?,
})
}
}
@ -1440,7 +1437,7 @@ impl<'a> Arbitrary<'a> for Transaction {
version: Version::arbitrary(u)?,
lock_time: LockTime::arbitrary(u)?,
input: Vec::<TxIn>::arbitrary(u)?,
output: Vec::<TxOut>::arbitrary(u)?
output: Vec::<TxOut>::arbitrary(u)?,
})
}
}

View File

@ -7,6 +7,8 @@
use core::fmt;
use core::ops::Index;
#[cfg(feature = "arbitrary")]
use arbitrary::{Arbitrary, Unstructured};
use internals::compact_size;
use io::{BufRead, Write};
@ -18,8 +20,6 @@ use crate::prelude::Vec;
use crate::script::ScriptExt as _;
use crate::taproot::{self, TAPROOT_ANNEX_PREFIX};
use crate::{Script, VarInt};
#[cfg(feature = "arbitrary")]
use arbitrary::{Arbitrary, Unstructured};
/// The Witness is the data used to unlock bitcoin since the [segwit upgrade].
///
@ -623,7 +623,7 @@ impl Default for Witness {
#[cfg(feature = "arbitrary")]
impl<'a> Arbitrary<'a> for Witness {
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
let arbitrary_bytes = Vec::<Vec::<u8>>::arbitrary(u)?;
let arbitrary_bytes = Vec::<Vec<u8>>::arbitrary(u)?;
Ok(Witness::from_slice(&arbitrary_bytes))
}
}

View File

@ -17,6 +17,8 @@
use core::fmt;
#[cfg(feature = "arbitrary")]
use arbitrary::{Arbitrary, Unstructured};
use internals::impl_to_hex_from_lower_hex;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
@ -24,8 +26,6 @@ use serde::{Deserialize, Serialize};
use units::locktime::relative::TimeOverflowError;
#[cfg(feature = "alloc")]
use units::parse::{self, PrefixedHexError, UnprefixedHexError};
#[cfg(feature = "arbitrary")]
use arbitrary::{Arbitrary, Unstructured};
#[cfg(feature = "alloc")]
use crate::locktime::relative;

View File

@ -12,9 +12,9 @@
use core::fmt;
use hashes::sha256d;
#[cfg(feature = "arbitrary")]
use arbitrary::{Arbitrary, Unstructured};
use hashes::sha256d;
hashes::hash_newtype! {
/// A bitcoin transaction hash/transaction ID.