diff --git a/bitcoin/src/bip152.rs b/bitcoin/src/bip152.rs index d454dfd555..289c7097c3 100644 --- a/bitcoin/src/bip152.rs +++ b/bitcoin/src/bip152.rs @@ -435,14 +435,20 @@ impl<'a> Arbitrary<'a> for HeaderAndShortIds { #[cfg(feature = "arbitrary")] impl<'a> Arbitrary<'a> for BlockTransactions { fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result { - Ok(BlockTransactions { block_hash: u.arbitrary()?, transactions: Vec::::arbitrary(u)? }) + Ok(BlockTransactions { + block_hash: u.arbitrary()?, + transactions: Vec::::arbitrary(u)?, + }) } } #[cfg(feature = "arbitrary")] impl<'a> Arbitrary<'a> for BlockTransactionsRequest { fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result { - Ok(BlockTransactionsRequest { block_hash: u.arbitrary()?, indexes: Vec::::arbitrary(u)? }) + Ok(BlockTransactionsRequest { + block_hash: u.arbitrary()?, + indexes: Vec::::arbitrary(u)?, + }) } } diff --git a/bitcoin/src/psbt/raw.rs b/bitcoin/src/psbt/raw.rs index c17766e603..df8dfa8443 100644 --- a/bitcoin/src/psbt/raw.rs +++ b/bitcoin/src/psbt/raw.rs @@ -6,9 +6,9 @@ //! . use core::fmt; + #[cfg(feature = "arbitrary")] use arbitrary::{Arbitrary, Unstructured}; - use internals::ToU64 as _; use io::{BufRead, Write}; @@ -197,7 +197,7 @@ impl<'a> Arbitrary<'a> for ProprietaryKey { Ok(ProprietaryKey { prefix: Vec::::arbitrary(u)?, subtype: u64::arbitrary(u)?, - key: Vec::::arbitrary(u)? + key: Vec::::arbitrary(u)?, }) } } diff --git a/p2p/src/message_network.rs b/p2p/src/message_network.rs index 16dcc3bf3d..c3b8bbb8d3 100644 --- a/p2p/src/message_network.rs +++ b/p2p/src/message_network.rs @@ -152,18 +152,20 @@ impl_consensus_encoding!(Reject, message, ccode, reason, hash); pub struct Alert(Vec); impl Alert { - const FINAL_ALERT: [u8; 96] = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 127, 0, 0, 0, 0, 255, 255, 255, 127, 254, 255, 255, 127, 1, 255, 255, 255, 127, 0, 0, 0, 0, 255, 255, 255, 127, 0, 255, 255, 255, 127, 0, 47, 85, 82, 71, 69, 78, 84, 58, 32, 65, 108, 101, 114, 116, 32, 107, 101, 121, 32, 99, 111, 109, 112, 114, 111, 109, 105, 115, 101, 100, 44, 32, 117, 112, 103, 114, 97, 100, 101, 32, 114, 101, 113, 117, 105, 114, 101, 100, 0]; + const FINAL_ALERT: [u8; 96] = [ + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 127, 0, 0, 0, 0, 255, 255, 255, 127, + 254, 255, 255, 127, 1, 255, 255, 255, 127, 0, 0, 0, 0, 255, 255, 255, 127, 0, 255, 255, + 255, 127, 0, 47, 85, 82, 71, 69, 78, 84, 58, 32, 65, 108, 101, 114, 116, 32, 107, 101, 121, + 32, 99, 111, 109, 112, 114, 111, 109, 105, 115, 101, 100, 44, 32, 117, 112, 103, 114, 97, + 100, 101, 32, 114, 101, 113, 117, 105, 114, 101, 100, 0, + ]; /// Build the final alert to send to a potentially vulerable peer. - pub fn final_alert() -> Self { - Self(Self::FINAL_ALERT.into()) - } + pub fn final_alert() -> Self { Self(Self::FINAL_ALERT.into()) } /// The final alert advertised by Bitcoin Core. This alert is sent if the advertised protocol /// version is vulerable to the alert-system vulerablities. - pub fn is_final_alert(&self) -> bool { - self.0.eq(&Self::FINAL_ALERT) - } + pub fn is_final_alert(&self) -> bool { self.0.eq(&Self::FINAL_ALERT) } } impl_vec_wrapper!(Alert, Vec);