@@ -8,7 +8,7 @@ use bech32::ToBase32;
88use bitcoin_hashes:: { Hash , sha256} ;
99use lightning:: chain;
1010use lightning:: chain:: chaininterface:: { BroadcasterInterface , FeeEstimator } ;
11- use lightning:: chain:: keysinterface:: { Recipient , KeysInterface , Sign } ;
11+ use lightning:: chain:: keysinterface:: { Recipient , KeysInterface } ;
1212use lightning:: ln:: { PaymentHash , PaymentPreimage , PaymentSecret } ;
1313use lightning:: ln:: channelmanager:: { ChannelDetails , ChannelManager , PaymentId , PaymentSendFailure , MIN_FINAL_CLTV_EXPIRY } ;
1414#[ cfg( feature = "std" ) ]
@@ -54,7 +54,7 @@ use crate::sync::Mutex;
5454/// [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
5555/// [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
5656/// [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
57- pub fn create_phantom_invoice < Signer : Sign , K : Deref , L : Deref > (
57+ pub fn create_phantom_invoice < K : Deref , L : Deref > (
5858 amt_msat : Option < u64 > , payment_hash : Option < PaymentHash > , description : String ,
5959 invoice_expiry_delta_secs : u32 , phantom_route_hints : Vec < PhantomRouteHints > , keys_manager : K ,
6060 logger : L , network : Currency ,
6565{
6666 let description = Description :: new ( description) . map_err ( SignOrCreationError :: CreationError ) ?;
6767 let description = InvoiceDescription :: Direct ( & description, ) ;
68- _create_phantom_invoice :: < Signer , K , L > (
68+ _create_phantom_invoice :: < K , L > (
6969 amt_msat, payment_hash, description, invoice_expiry_delta_secs, phantom_route_hints,
7070 keys_manager, logger, network,
7171 )
@@ -103,7 +103,7 @@ where
103103/// [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
104104/// [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
105105/// [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
106- pub fn create_phantom_invoice_with_description_hash < Signer : Sign , K : Deref , L : Deref > (
106+ pub fn create_phantom_invoice_with_description_hash < K : Deref , L : Deref > (
107107 amt_msat : Option < u64 > , payment_hash : Option < PaymentHash > , invoice_expiry_delta_secs : u32 ,
108108 description_hash : Sha256 , phantom_route_hints : Vec < PhantomRouteHints > , keys_manager : K ,
109109 logger : L , network : Currency
@@ -112,14 +112,14 @@ where
112112 K :: Target : KeysInterface ,
113113 L :: Target : Logger ,
114114{
115- _create_phantom_invoice :: < Signer , K , L > (
115+ _create_phantom_invoice :: < K , L > (
116116 amt_msat, payment_hash, InvoiceDescription :: Hash ( & description_hash) ,
117117 invoice_expiry_delta_secs, phantom_route_hints, keys_manager, logger, network,
118118 )
119119}
120120
121121#[ cfg( feature = "std" ) ]
122- fn _create_phantom_invoice < Signer : Sign , K : Deref , L : Deref > (
122+ fn _create_phantom_invoice < K : Deref , L : Deref > (
123123 amt_msat : Option < u64 > , payment_hash : Option < PaymentHash > , description : InvoiceDescription ,
124124 invoice_expiry_delta_secs : u32 , phantom_route_hints : Vec < PhantomRouteHints > , keys_manager : K ,
125125 logger : L , network : Currency ,
@@ -690,7 +690,6 @@ mod test {
690690 use lightning:: ln:: functional_test_utils:: * ;
691691 use lightning:: ln:: msgs:: ChannelMessageHandler ;
692692 use lightning:: routing:: router:: { PaymentParameters , RouteParameters , find_route} ;
693- use lightning:: util:: enforcing_trait_impls:: EnforcingSigner ;
694693 use lightning:: util:: events:: { MessageSendEvent , MessageSendEventsProvider , Event } ;
695694 use lightning:: util:: test_utils;
696695 use lightning:: util:: config:: UserConfig ;
@@ -1016,7 +1015,7 @@ mod test {
10161015 let non_default_invoice_expiry_secs = 4200 ;
10171016
10181017 let invoice =
1019- crate :: utils:: create_phantom_invoice :: < EnforcingSigner , & test_utils:: TestKeysInterface , & test_utils:: TestLogger > (
1018+ crate :: utils:: create_phantom_invoice :: < & test_utils:: TestKeysInterface , & test_utils:: TestLogger > (
10201019 Some ( payment_amt) , payment_hash, "test" . to_string ( ) , non_default_invoice_expiry_secs,
10211020 route_hints, & nodes[ 1 ] . keys_manager , & nodes[ 1 ] . logger , Currency :: BitcoinTestnet
10221021 ) . unwrap ( ) ;
@@ -1125,7 +1124,7 @@ mod test {
11251124 nodes[ 2 ] . node. get_phantom_route_hints( ) ,
11261125 ] ;
11271126
1128- let invoice = crate :: utils:: create_phantom_invoice :: < EnforcingSigner , & test_utils:: TestKeysInterface , & test_utils:: TestLogger > ( Some ( payment_amt) , Some ( payment_hash) , "test" . to_string ( ) , 3600 , route_hints, & nodes[ 1 ] . keys_manager , & nodes[ 1 ] . logger , Currency :: BitcoinTestnet ) . unwrap ( ) ;
1127+ let invoice = crate :: utils:: create_phantom_invoice :: < & test_utils:: TestKeysInterface , & test_utils:: TestLogger > ( Some ( payment_amt) , Some ( payment_hash) , "test" . to_string ( ) , 3600 , route_hints, & nodes[ 1 ] . keys_manager , & nodes[ 1 ] . logger , Currency :: BitcoinTestnet ) . unwrap ( ) ;
11291128
11301129 let chan_0_1 = & nodes[ 1 ] . node . list_usable_channels ( ) [ 0 ] ;
11311130 assert_eq ! ( invoice. route_hints( ) [ 0 ] . 0 [ 0 ] . htlc_minimum_msat, chan_0_1. inbound_htlc_minimum_msat) ;
@@ -1153,7 +1152,7 @@ mod test {
11531152 let description_hash = crate :: Sha256 ( Hash :: hash ( "Description hash phantom invoice" . as_bytes ( ) ) ) ;
11541153 let non_default_invoice_expiry_secs = 4200 ;
11551154 let invoice = crate :: utils:: create_phantom_invoice_with_description_hash :: <
1156- EnforcingSigner , & test_utils:: TestKeysInterface , & test_utils:: TestLogger ,
1155+ & test_utils:: TestKeysInterface , & test_utils:: TestLogger ,
11571156 > (
11581157 Some ( payment_amt) , None , non_default_invoice_expiry_secs, description_hash,
11591158 route_hints, & nodes[ 1 ] . keys_manager , & nodes[ 1 ] . logger , Currency :: BitcoinTestnet
@@ -1470,7 +1469,7 @@ mod test {
14701469 . map ( |route_hint| route_hint. phantom_scid )
14711470 . collect :: < HashSet < u64 > > ( ) ;
14721471
1473- let invoice = crate :: utils:: create_phantom_invoice :: < EnforcingSigner , & test_utils:: TestKeysInterface , & test_utils:: TestLogger > ( invoice_amt, None , "test" . to_string ( ) , 3600 , phantom_route_hints, & invoice_node. keys_manager , & invoice_node. logger , Currency :: BitcoinTestnet ) . unwrap ( ) ;
1472+ let invoice = crate :: utils:: create_phantom_invoice :: < & test_utils:: TestKeysInterface , & test_utils:: TestLogger > ( invoice_amt, None , "test" . to_string ( ) , 3600 , phantom_route_hints, & invoice_node. keys_manager , & invoice_node. logger , Currency :: BitcoinTestnet ) . unwrap ( ) ;
14741473
14751474 let invoice_hints = invoice. private_routes ( ) ;
14761475
0 commit comments