]> git.bitcoin.ninja Git - rust-lightning/commitdiff
`rustfmt`: `fuzz/src/refund_deser.rs`
authorElias Rohrer <dev@tnull.de>
Thu, 6 Jun 2024 11:12:07 +0000 (13:12 +0200)
committerElias Rohrer <dev@tnull.de>
Fri, 7 Jun 2024 18:42:36 +0000 (20:42 +0200)
fuzz/src/refund_deser.rs
rustfmt_excluded_files

index 7937ca1efc60f8ef8e87049b7956acc16c7c1d60..11907b6d6965c121be2c6d612453d9169893b8d8 100644 (file)
@@ -7,17 +7,17 @@
 // You may not use this file except in accordance with one or both of these
 // licenses.
 
-use bitcoin::secp256k1::{Keypair, PublicKey, Secp256k1, SecretKey, self};
 use crate::utils::test_logger;
+use bitcoin::secp256k1::{self, Keypair, PublicKey, Secp256k1, SecretKey};
 use core::convert::TryFrom;
-use lightning::blinded_path::BlindedPath;
 use lightning::blinded_path::message::ForwardNode;
-use lightning::sign::EntropySource;
-use lightning::ln::PaymentHash;
+use lightning::blinded_path::BlindedPath;
 use lightning::ln::features::BlindedHopFeatures;
+use lightning::ln::PaymentHash;
 use lightning::offers::invoice::{BlindedPayInfo, UnsignedBolt12Invoice};
 use lightning::offers::parse::Bolt12SemanticError;
 use lightning::offers::refund::Refund;
+use lightning::sign::EntropySource;
 use lightning::util::ser::Writeable;
 
 #[inline]
@@ -34,9 +34,9 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], _out: Out) {
 
                if let Ok(invoice) = build_response(&refund, pubkey, &secp_ctx) {
                        invoice
-                               .sign(|message: &UnsignedBolt12Invoice|
+                               .sign(|message: &UnsignedBolt12Invoice| {
                                        Ok(secp_ctx.sign_schnorr_no_aux_rand(message.as_ref().as_digest(), &keys))
-                               )
+                               })
                                .unwrap()
                                .write(&mut buffer)
                                .unwrap();
@@ -47,7 +47,9 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], _out: Out) {
 struct Randomness;
 
 impl EntropySource for Randomness {
-       fn get_secure_random_bytes(&self) -> [u8; 32] { [42; 32] }
+       fn get_secure_random_bytes(&self) -> [u8; 32] {
+               [42; 32]
+       }
 }
 
 fn pubkey(byte: u8) -> PublicKey {
@@ -60,7 +62,7 @@ fn privkey(byte: u8) -> SecretKey {
 }
 
 fn build_response<T: secp256k1::Signing + secp256k1::Verification>(
-       refund: &Refund, signing_pubkey: PublicKey, secp_ctx: &Secp256k1<T>
+       refund: &Refund, signing_pubkey: PublicKey, secp_ctx: &Secp256k1<T>,
 ) -> Result<UnsignedBolt12Invoice, Bolt12SemanticError> {
        let entropy_source = Randomness {};
        let intermediate_nodes = [
@@ -74,8 +76,10 @@ fn build_response<T: secp256k1::Signing + secp256k1::Verification>(
                ],
        ];
        let paths = vec![
-               BlindedPath::new_for_message(&intermediate_nodes[0], pubkey(42), &entropy_source, secp_ctx).unwrap(),
-               BlindedPath::new_for_message(&intermediate_nodes[1], pubkey(42), &entropy_source, secp_ctx).unwrap(),
+               BlindedPath::new_for_message(&intermediate_nodes[0], pubkey(42), &entropy_source, secp_ctx)
+                       .unwrap(),
+               BlindedPath::new_for_message(&intermediate_nodes[1], pubkey(42), &entropy_source, secp_ctx)
+                       .unwrap(),
        ];
 
        let payinfo = vec![
index 9532bbe3ee287a6e0d9f2f8c5bfc27368a34eaf2..c27a84e70ef460d9c8eabafa4481597ba3fb816e 100644 (file)
@@ -1,7 +1,6 @@
 ./bench/benches/bench.rs
 ./fuzz/src/chanmon_consistency.rs
 ./fuzz/src/full_stack.rs
-./fuzz/src/refund_deser.rs
 ./fuzz/src/router.rs
 ./fuzz/src/utils/mod.rs
 ./fuzz/src/utils/test_logger.rs