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 } ;
1110use crate :: utils:: test_logger;
11+ use bitcoin:: secp256k1:: { self , Keypair , PublicKey , Secp256k1 , SecretKey } ;
1212use core:: convert:: TryFrom ;
13- use lightning:: blinded_path:: BlindedPath ;
1413use lightning:: blinded_path:: message:: ForwardNode ;
15- use lightning:: sign:: EntropySource ;
16- use lightning:: ln:: PaymentHash ;
14+ use lightning:: blinded_path:: BlindedPath ;
1715use lightning:: ln:: features:: BlindedHopFeatures ;
16+ use lightning:: ln:: PaymentHash ;
1817use lightning:: offers:: invoice:: { BlindedPayInfo , UnsignedBolt12Invoice } ;
1918use lightning:: offers:: parse:: Bolt12SemanticError ;
2019use lightning:: offers:: refund:: Refund ;
20+ use lightning:: sign:: EntropySource ;
2121use 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) {
4747struct Randomness ;
4848
4949impl 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
5355fn pubkey ( byte : u8 ) -> PublicKey {
@@ -60,7 +62,7 @@ fn privkey(byte: u8) -> SecretKey {
6062}
6163
6264fn 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 ! [
0 commit comments