Run the formatter
I don't want to wait for the bot, just run the formatter now. No manual changes.
This commit is contained in:
parent
0511f44d99
commit
40bee24de7
|
@ -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!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue