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: ACK2009763ae5
successfully ran local tests Tree-SHA512: 3e80d6d3b72eb4ce26dfeac7ced916c7f9b76368bdbd4273d5d558fc9da89f16a24e2d8e99cdd4a528cf73514affd9fc8fb454543cc124b90567418824dfebeb
This commit is contained in:
commit
5690a64667
|
@ -1412,21 +1412,18 @@ impl InputWeightPrediction {
|
||||||
#[cfg(feature = "arbitrary")]
|
#[cfg(feature = "arbitrary")]
|
||||||
impl<'a> Arbitrary<'a> for OutPoint {
|
impl<'a> Arbitrary<'a> for OutPoint {
|
||||||
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
|
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
|
||||||
Ok(OutPoint{
|
Ok(OutPoint { txid: Txid::arbitrary(u)?, vout: u32::arbitrary(u)? })
|
||||||
txid: Txid::arbitrary(u)?,
|
|
||||||
vout: u32::arbitrary(u)?
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "arbitrary")]
|
#[cfg(feature = "arbitrary")]
|
||||||
impl<'a> Arbitrary<'a> for TxIn {
|
impl<'a> Arbitrary<'a> for TxIn {
|
||||||
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
|
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
|
||||||
Ok(TxIn{
|
Ok(TxIn {
|
||||||
previous_output: OutPoint::arbitrary(u)?,
|
previous_output: OutPoint::arbitrary(u)?,
|
||||||
script_sig: ScriptBuf::arbitrary(u)?,
|
script_sig: ScriptBuf::arbitrary(u)?,
|
||||||
sequence: Sequence::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)?,
|
version: Version::arbitrary(u)?,
|
||||||
lock_time: LockTime::arbitrary(u)?,
|
lock_time: LockTime::arbitrary(u)?,
|
||||||
input: Vec::<TxIn>::arbitrary(u)?,
|
input: Vec::<TxIn>::arbitrary(u)?,
|
||||||
output: Vec::<TxOut>::arbitrary(u)?
|
output: Vec::<TxOut>::arbitrary(u)?,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
use core::ops::Index;
|
use core::ops::Index;
|
||||||
|
|
||||||
|
#[cfg(feature = "arbitrary")]
|
||||||
|
use arbitrary::{Arbitrary, Unstructured};
|
||||||
use internals::compact_size;
|
use internals::compact_size;
|
||||||
use io::{BufRead, Write};
|
use io::{BufRead, Write};
|
||||||
|
|
||||||
|
@ -18,8 +20,6 @@ use crate::prelude::Vec;
|
||||||
use crate::script::ScriptExt as _;
|
use crate::script::ScriptExt as _;
|
||||||
use crate::taproot::{self, TAPROOT_ANNEX_PREFIX};
|
use crate::taproot::{self, TAPROOT_ANNEX_PREFIX};
|
||||||
use crate::{Script, VarInt};
|
use crate::{Script, VarInt};
|
||||||
#[cfg(feature = "arbitrary")]
|
|
||||||
use arbitrary::{Arbitrary, Unstructured};
|
|
||||||
|
|
||||||
/// The Witness is the data used to unlock bitcoin since the [segwit upgrade].
|
/// The Witness is the data used to unlock bitcoin since the [segwit upgrade].
|
||||||
///
|
///
|
||||||
|
@ -623,7 +623,7 @@ impl Default for Witness {
|
||||||
#[cfg(feature = "arbitrary")]
|
#[cfg(feature = "arbitrary")]
|
||||||
impl<'a> Arbitrary<'a> for Witness {
|
impl<'a> Arbitrary<'a> for Witness {
|
||||||
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
|
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))
|
Ok(Witness::from_slice(&arbitrary_bytes))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
|
|
||||||
|
#[cfg(feature = "arbitrary")]
|
||||||
|
use arbitrary::{Arbitrary, Unstructured};
|
||||||
use internals::impl_to_hex_from_lower_hex;
|
use internals::impl_to_hex_from_lower_hex;
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
@ -24,8 +26,6 @@ use serde::{Deserialize, Serialize};
|
||||||
use units::locktime::relative::TimeOverflowError;
|
use units::locktime::relative::TimeOverflowError;
|
||||||
#[cfg(feature = "alloc")]
|
#[cfg(feature = "alloc")]
|
||||||
use units::parse::{self, PrefixedHexError, UnprefixedHexError};
|
use units::parse::{self, PrefixedHexError, UnprefixedHexError};
|
||||||
#[cfg(feature = "arbitrary")]
|
|
||||||
use arbitrary::{Arbitrary, Unstructured};
|
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
#[cfg(feature = "alloc")]
|
||||||
use crate::locktime::relative;
|
use crate::locktime::relative;
|
||||||
|
|
|
@ -12,9 +12,9 @@
|
||||||
|
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
|
|
||||||
use hashes::sha256d;
|
|
||||||
#[cfg(feature = "arbitrary")]
|
#[cfg(feature = "arbitrary")]
|
||||||
use arbitrary::{Arbitrary, Unstructured};
|
use arbitrary::{Arbitrary, Unstructured};
|
||||||
|
use hashes::sha256d;
|
||||||
|
|
||||||
hashes::hash_newtype! {
|
hashes::hash_newtype! {
|
||||||
/// A bitcoin transaction hash/transaction ID.
|
/// A bitcoin transaction hash/transaction ID.
|
||||||
|
|
Loading…
Reference in New Issue