@@ -8,7 +8,7 @@ use bech32::ToBase32;
8
8
use bitcoin_hashes:: { Hash , sha256} ;
9
9
use lightning:: chain;
10
10
use lightning:: chain:: chaininterface:: { BroadcasterInterface , FeeEstimator } ;
11
- use lightning:: chain:: keysinterface:: { Recipient , KeysInterface , Sign } ;
11
+ use lightning:: chain:: keysinterface:: { Recipient , KeysInterface } ;
12
12
use lightning:: ln:: { PaymentHash , PaymentPreimage , PaymentSecret } ;
13
13
use lightning:: ln:: channelmanager:: { ChannelDetails , ChannelManager , PaymentId , PaymentSendFailure , MIN_FINAL_CLTV_EXPIRY } ;
14
14
#[ cfg( feature = "std" ) ]
@@ -54,7 +54,7 @@ use crate::sync::Mutex;
54
54
/// [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
55
55
/// [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
56
56
/// [`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 > (
58
58
amt_msat : Option < u64 > , payment_hash : Option < PaymentHash > , description : String ,
59
59
invoice_expiry_delta_secs : u32 , phantom_route_hints : Vec < PhantomRouteHints > , keys_manager : K ,
60
60
logger : L , network : Currency ,
65
65
{
66
66
let description = Description :: new ( description) . map_err ( SignOrCreationError :: CreationError ) ?;
67
67
let description = InvoiceDescription :: Direct ( & description, ) ;
68
- _create_phantom_invoice :: < Signer , K , L > (
68
+ _create_phantom_invoice :: < K , L > (
69
69
amt_msat, payment_hash, description, invoice_expiry_delta_secs, phantom_route_hints,
70
70
keys_manager, logger, network,
71
71
)
@@ -103,7 +103,7 @@ where
103
103
/// [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
104
104
/// [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
105
105
/// [`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 > (
107
107
amt_msat : Option < u64 > , payment_hash : Option < PaymentHash > , invoice_expiry_delta_secs : u32 ,
108
108
description_hash : Sha256 , phantom_route_hints : Vec < PhantomRouteHints > , keys_manager : K ,
109
109
logger : L , network : Currency
@@ -112,14 +112,14 @@ where
112
112
K :: Target : KeysInterface ,
113
113
L :: Target : Logger ,
114
114
{
115
- _create_phantom_invoice :: < Signer , K , L > (
115
+ _create_phantom_invoice :: < K , L > (
116
116
amt_msat, payment_hash, InvoiceDescription :: Hash ( & description_hash) ,
117
117
invoice_expiry_delta_secs, phantom_route_hints, keys_manager, logger, network,
118
118
)
119
119
}
120
120
121
121
#[ cfg( feature = "std" ) ]
122
- fn _create_phantom_invoice < Signer : Sign , K : Deref , L : Deref > (
122
+ fn _create_phantom_invoice < K : Deref , L : Deref > (
123
123
amt_msat : Option < u64 > , payment_hash : Option < PaymentHash > , description : InvoiceDescription ,
124
124
invoice_expiry_delta_secs : u32 , phantom_route_hints : Vec < PhantomRouteHints > , keys_manager : K ,
125
125
logger : L , network : Currency ,
@@ -690,7 +690,6 @@ mod test {
690
690
use lightning:: ln:: functional_test_utils:: * ;
691
691
use lightning:: ln:: msgs:: ChannelMessageHandler ;
692
692
use lightning:: routing:: router:: { PaymentParameters , RouteParameters , find_route} ;
693
- use lightning:: util:: enforcing_trait_impls:: EnforcingSigner ;
694
693
use lightning:: util:: events:: { MessageSendEvent , MessageSendEventsProvider , Event } ;
695
694
use lightning:: util:: test_utils;
696
695
use lightning:: util:: config:: UserConfig ;
@@ -1016,7 +1015,7 @@ mod test {
1016
1015
let non_default_invoice_expiry_secs = 4200 ;
1017
1016
1018
1017
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 > (
1020
1019
Some ( payment_amt) , payment_hash, "test" . to_string ( ) , non_default_invoice_expiry_secs,
1021
1020
route_hints, & nodes[ 1 ] . keys_manager , & nodes[ 1 ] . logger , Currency :: BitcoinTestnet
1022
1021
) . unwrap ( ) ;
@@ -1125,7 +1124,7 @@ mod test {
1125
1124
nodes[ 2 ] . node. get_phantom_route_hints( ) ,
1126
1125
] ;
1127
1126
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 ( ) ;
1129
1128
1130
1129
let chan_0_1 = & nodes[ 1 ] . node . list_usable_channels ( ) [ 0 ] ;
1131
1130
assert_eq ! ( invoice. route_hints( ) [ 0 ] . 0 [ 0 ] . htlc_minimum_msat, chan_0_1. inbound_htlc_minimum_msat) ;
@@ -1153,7 +1152,7 @@ mod test {
1153
1152
let description_hash = crate :: Sha256 ( Hash :: hash ( "Description hash phantom invoice" . as_bytes ( ) ) ) ;
1154
1153
let non_default_invoice_expiry_secs = 4200 ;
1155
1154
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 ,
1157
1156
> (
1158
1157
Some ( payment_amt) , None , non_default_invoice_expiry_secs, description_hash,
1159
1158
route_hints, & nodes[ 1 ] . keys_manager , & nodes[ 1 ] . logger , Currency :: BitcoinTestnet
@@ -1470,7 +1469,7 @@ mod test {
1470
1469
. map ( |route_hint| route_hint. phantom_scid )
1471
1470
. collect :: < HashSet < u64 > > ( ) ;
1472
1471
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 ( ) ;
1474
1473
1475
1474
let invoice_hints = invoice. private_routes ( ) ;
1476
1475
0 commit comments