Merge rust-bitcoin/rust-bitcoin#4555: Automated nightly rustfmt (2025-05-25)
c73131c8f0
2025-05-25 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 c73131c8f0ea7654ac392e4170737092515c1abc; successfully ran local tests
Tree-SHA512: 51995608b286cbccce0cf81e77c72ec6d25be91219e8e9bf34245a66a6f089b6bcd9d4313f1dc82068655010268dd33f586208cfe9ebbfaed6e517b1fc3a4c37
This commit is contained in:
commit
6e66253ffb
|
@ -749,12 +749,11 @@ impl serde::Serialize for Psbt {
|
|||
impl<'de> serde::Deserialize<'de> for Psbt {
|
||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||
where
|
||||
D: serde::Deserializer<'de>
|
||||
D: serde::Deserializer<'de>,
|
||||
{
|
||||
struct Visitor;
|
||||
|
||||
impl<'de> serde::de::Visitor<'de> for Visitor
|
||||
{
|
||||
impl<'de> serde::de::Visitor<'de> for Visitor {
|
||||
type Value = Psbt;
|
||||
|
||||
fn expecting(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
|
||||
|
@ -762,8 +761,7 @@ impl<'de> serde::Deserialize<'de> for Psbt {
|
|||
}
|
||||
|
||||
fn visit_bytes<E: serde::de::Error>(self, bytes: &[u8]) -> Result<Self::Value, E> {
|
||||
Psbt::deserialize(bytes)
|
||||
.map_err(|e| serde::de::Error::custom(e))
|
||||
Psbt::deserialize(bytes).map_err(|e| serde::de::Error::custom(e))
|
||||
}
|
||||
|
||||
fn visit_str<E: serde::de::Error>(self, s: &str) -> Result<Self::Value, E> {
|
||||
|
@ -1456,17 +1454,15 @@ mod tests {
|
|||
Err(ABSURD_FEE_RATE)
|
||||
);
|
||||
assert_eq!(
|
||||
psbt.clone()
|
||||
.extract_tx_with_fee_rate_limit(JUST_BELOW_ABSURD_FEE_RATE)
|
||||
.map_err(|e| match e {
|
||||
psbt.clone().extract_tx_with_fee_rate_limit(JUST_BELOW_ABSURD_FEE_RATE).map_err(|e| {
|
||||
match e {
|
||||
ExtractTxError::AbsurdFeeRate { fee_rate, .. } => fee_rate,
|
||||
_ => panic!(""),
|
||||
}
|
||||
}),
|
||||
Err(ABSURD_FEE_RATE)
|
||||
);
|
||||
assert!(psbt
|
||||
.extract_tx_with_fee_rate_limit(ABSURD_FEE_RATE)
|
||||
.is_ok());
|
||||
assert!(psbt.extract_tx_with_fee_rate_limit(ABSURD_FEE_RATE).is_ok());
|
||||
|
||||
// Testing that extract_tx will error at 25k sat/vbyte (6250000 sat/kwu)
|
||||
assert_eq!(
|
||||
|
|
|
@ -30,8 +30,7 @@ use bitcoin::consensus::encode::deserialize;
|
|||
use bitcoin::hashes::{hash160, ripemd160, sha256, sha256d};
|
||||
use bitcoin::hex::FromHex;
|
||||
use bitcoin::locktime::{absolute, relative};
|
||||
use bitcoin::psbt::raw;
|
||||
use bitcoin::psbt::{Input, Output, Psbt, PsbtSighashType};
|
||||
use bitcoin::psbt::{raw, Input, Output, Psbt, PsbtSighashType};
|
||||
use bitcoin::script::ScriptBufExt as _;
|
||||
use bitcoin::sighash::{EcdsaSighashType, TapSighashType};
|
||||
use bitcoin::taproot::{self, ControlBlock, LeafVersion, TapTree, TaprootBuilder};
|
||||
|
|
|
@ -19,26 +19,17 @@ fn do_test(data: &[u8]) {
|
|||
|
||||
if let Ok(ip_addr) = IpAddr::try_from(addr_v2.clone()) {
|
||||
let round_trip: AddrV2 = AddrV2::from(ip_addr);
|
||||
assert_eq!(
|
||||
addr_v2, round_trip,
|
||||
"AddrV2 -> IpAddr -> AddrV2 should round-trip correctly"
|
||||
);
|
||||
assert_eq!(addr_v2, round_trip, "AddrV2 -> IpAddr -> AddrV2 should round-trip correctly");
|
||||
}
|
||||
|
||||
if let Ok(ip_addr) = Ipv4Addr::try_from(addr_v2.clone()) {
|
||||
let round_trip: AddrV2 = AddrV2::from(ip_addr);
|
||||
assert_eq!(
|
||||
addr_v2, round_trip,
|
||||
"AddrV2 -> Ipv4Addr -> AddrV2 should round-trip correctly"
|
||||
);
|
||||
assert_eq!(addr_v2, round_trip, "AddrV2 -> Ipv4Addr -> AddrV2 should round-trip correctly");
|
||||
}
|
||||
|
||||
if let Ok(ip_addr) = Ipv6Addr::try_from(addr_v2.clone()) {
|
||||
let round_trip: AddrV2 = AddrV2::from(ip_addr);
|
||||
assert_eq!(
|
||||
addr_v2, round_trip,
|
||||
"AddrV2 -> Ipv6Addr -> AddrV2 should round-trip correctly"
|
||||
);
|
||||
assert_eq!(addr_v2, round_trip, "AddrV2 -> Ipv6Addr -> AddrV2 should round-trip correctly");
|
||||
}
|
||||
|
||||
if let Ok(socket_addr) = SocketAddr::try_from(addr_v2.clone()) {
|
||||
|
|
|
@ -347,7 +347,6 @@ impl fmt::Display for ParseDenominationError {
|
|||
#[cfg(feature = "std")]
|
||||
impl std::error::Error for ParseDenominationError {
|
||||
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
||||
|
||||
match *self {
|
||||
Self::Unknown(_) | Self::PossiblyConfusing(_) => None,
|
||||
}
|
||||
|
|
|
@ -377,7 +377,6 @@ impl ParseError {
|
|||
) -> fmt::Result {
|
||||
use core::num::IntErrorKind;
|
||||
|
||||
|
||||
match self {
|
||||
Self::ParseInt(ParseIntError { input, bits: _, is_signed: _, source })
|
||||
if *source.kind() == IntErrorKind::PosOverflow =>
|
||||
|
@ -425,7 +424,6 @@ impl ParseError {
|
|||
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
||||
use core::num::IntErrorKind;
|
||||
|
||||
|
||||
match self {
|
||||
Self::ParseInt(ParseIntError { source, .. })
|
||||
if *source.kind() == IntErrorKind::PosOverflow =>
|
||||
|
|
Loading…
Reference in New Issue