Skip to content

Commit d98c024

Browse files
committed
rustfmt: fuzz/src/refund_deser.rs
1 parent eece709 commit d98c024

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

fuzz/src/refund_deser.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
// You may not use this file except in accordance with one or both of these
88
// licenses.
99

10-
use bitcoin::secp256k1::{Keypair, PublicKey, Secp256k1, SecretKey, self};
1110
use crate::utils::test_logger;
11+
use bitcoin::secp256k1::{self, Keypair, PublicKey, Secp256k1, SecretKey};
1212
use core::convert::TryFrom;
13-
use lightning::blinded_path::BlindedPath;
1413
use lightning::blinded_path::message::ForwardNode;
15-
use lightning::sign::EntropySource;
16-
use lightning::ln::PaymentHash;
14+
use lightning::blinded_path::BlindedPath;
1715
use lightning::ln::features::BlindedHopFeatures;
16+
use lightning::ln::PaymentHash;
1817
use lightning::offers::invoice::{BlindedPayInfo, UnsignedBolt12Invoice};
1918
use lightning::offers::parse::Bolt12SemanticError;
2019
use lightning::offers::refund::Refund;
20+
use lightning::sign::EntropySource;
2121
use lightning::util::ser::Writeable;
2222

2323
#[inline]
@@ -34,9 +34,9 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], _out: Out) {
3434

3535
if let Ok(invoice) = build_response(&refund, pubkey, &secp_ctx) {
3636
invoice
37-
.sign(|message: &UnsignedBolt12Invoice|
37+
.sign(|message: &UnsignedBolt12Invoice| {
3838
Ok(secp_ctx.sign_schnorr_no_aux_rand(message.as_ref().as_digest(), &keys))
39-
)
39+
})
4040
.unwrap()
4141
.write(&mut buffer)
4242
.unwrap();
@@ -47,7 +47,9 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], _out: Out) {
4747
struct Randomness;
4848

4949
impl EntropySource for Randomness {
50-
fn get_secure_random_bytes(&self) -> [u8; 32] { [42; 32] }
50+
fn get_secure_random_bytes(&self) -> [u8; 32] {
51+
[42; 32]
52+
}
5153
}
5254

5355
fn pubkey(byte: u8) -> PublicKey {
@@ -60,7 +62,7 @@ fn privkey(byte: u8) -> SecretKey {
6062
}
6163

6264
fn build_response<T: secp256k1::Signing + secp256k1::Verification>(
63-
refund: &Refund, signing_pubkey: PublicKey, secp_ctx: &Secp256k1<T>
65+
refund: &Refund, signing_pubkey: PublicKey, secp_ctx: &Secp256k1<T>,
6466
) -> Result<UnsignedBolt12Invoice, Bolt12SemanticError> {
6567
let entropy_source = Randomness {};
6668
let intermediate_nodes = [
@@ -74,8 +76,10 @@ fn build_response<T: secp256k1::Signing + secp256k1::Verification>(
7476
],
7577
];
7678
let paths = vec![
77-
BlindedPath::new_for_message(&intermediate_nodes[0], pubkey(42), &entropy_source, secp_ctx).unwrap(),
78-
BlindedPath::new_for_message(&intermediate_nodes[1], pubkey(42), &entropy_source, secp_ctx).unwrap(),
79+
BlindedPath::new_for_message(&intermediate_nodes[0], pubkey(42), &entropy_source, secp_ctx)
80+
.unwrap(),
81+
BlindedPath::new_for_message(&intermediate_nodes[1], pubkey(42), &entropy_source, secp_ctx)
82+
.unwrap(),
7983
];
8084

8185
let payinfo = vec![

rustfmt_excluded_files

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
./bench/benches/bench.rs
2-
./fuzz/src/refund_deser.rs
32
./fuzz/src/router.rs
43
./fuzz/src/utils/mod.rs
54
./fuzz/src/utils/test_logger.rs

0 commit comments

Comments
 (0)