40bee24de7 Run the formatter (Tobin C. Harding)

Pull request description:

  I don't want to wait for the bot, just run the formatter now.

  No manual changes.

ACKs for top commit:
  apoelstra:
    ACK 40bee24de7 fine by me, but will give Kix 2 days to express displeasure, at which point the bot will pretty-much be ready to run
  Kixunil:
    ACK 40bee24de7

Tree-SHA512: a9e54305062900dc18f73c61deef0af74702c17f7040614f5f8697a47dd084d07a9c321878c5e29910e2a8d129bac23b95ee1023176beddf2e915544b13e7b0c
This commit is contained in:
merge-script 2024-07-11 20:37:48 +00:00
commit ce7ce6ca9b
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
2 changed files with 8 additions and 5 deletions

View File

@ -166,7 +166,7 @@ impl Decodable for HeaderAndShortIds {
header: Decodable::consensus_decode(r)?, header: Decodable::consensus_decode(r)?,
nonce: Decodable::consensus_decode(r)?, nonce: Decodable::consensus_decode(r)?,
short_ids: Decodable::consensus_decode(r)?, short_ids: Decodable::consensus_decode(r)?,
prefilled_txs: Decodable::consensus_decode(r)? prefilled_txs: Decodable::consensus_decode(r)?,
}; };
match header_short_ids.short_ids.len().checked_add(header_short_ids.prefilled_txs.len()) { match header_short_ids.short_ids.len().checked_add(header_short_ids.prefilled_txs.len()) {
Some(x) if x <= u16::MAX.into() => Ok(header_short_ids), Some(x) if x <= u16::MAX.into() => Ok(header_short_ids),
@ -244,8 +244,10 @@ impl HeaderAndShortIds {
}); });
} else { } else {
match version { match version {
1 => short_ids.push(ShortId::with_siphash_keys(&tx.compute_txid(), siphash_keys)), 1 =>
2 => short_ids.push(ShortId::with_siphash_keys(&tx.compute_wtxid(), siphash_keys)), short_ids.push(ShortId::with_siphash_keys(&tx.compute_txid(), siphash_keys)),
2 => short_ids
.push(ShortId::with_siphash_keys(&tx.compute_wtxid(), siphash_keys)),
_ => unreachable!(), _ => unreachable!(),
} }
} }

View File

@ -3,7 +3,7 @@
//! Provides [`Height`] and [`Time`] types used by the `rust-bitcoin` `absolute::LockTime` type. //! Provides [`Height`] and [`Time`] types used by the `rust-bitcoin` `absolute::LockTime` type.
#[cfg(feature = "alloc")] #[cfg(feature = "alloc")]
use alloc::{string::String, boxed::Box}; use alloc::{boxed::Box, string::String};
use core::fmt; use core::fmt;
use internals::write_err; use internals::write_err;
@ -372,10 +372,11 @@ impl From<ConversionError> for ParseError {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*;
#[cfg(feature = "serde")] #[cfg(feature = "serde")]
use internals::serde_round_trip; use internals::serde_round_trip;
use super::*;
#[test] #[test]
fn time_from_str_hex_happy_path() { fn time_from_str_hex_happy_path() {
let actual = Time::from_hex("0x6289C350").unwrap(); let actual = Time::from_hex("0x6289C350").unwrap();