@@ -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 ,
@@ -1009,7 +1009,7 @@ mod test {
1009
1009
let non_default_invoice_expiry_secs = 4200 ;
1010
1010
1011
1011
let invoice =
1012
- crate :: utils:: create_phantom_invoice :: < EnforcingSigner , & test_utils:: TestKeysInterface , & test_utils:: TestLogger > (
1012
+ crate :: utils:: create_phantom_invoice :: < & test_utils:: TestKeysInterface , & test_utils:: TestLogger > (
1013
1013
Some ( payment_amt) , payment_hash, "test" . to_string ( ) , non_default_invoice_expiry_secs,
1014
1014
route_hints, & nodes[ 1 ] . keys_manager , & nodes[ 1 ] . logger , Currency :: BitcoinTestnet
1015
1015
) . unwrap ( ) ;
@@ -1118,7 +1118,7 @@ mod test {
1118
1118
nodes[ 2 ] . node. get_phantom_route_hints( ) ,
1119
1119
] ;
1120
1120
1121
- 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 ( ) ;
1121
+ 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 ( ) ;
1122
1122
1123
1123
let chan_0_1 = & nodes[ 1 ] . node . list_usable_channels ( ) [ 0 ] ;
1124
1124
assert_eq ! ( invoice. route_hints( ) [ 0 ] . 0 [ 0 ] . htlc_minimum_msat, chan_0_1. inbound_htlc_minimum_msat) ;
@@ -1146,7 +1146,7 @@ mod test {
1146
1146
let description_hash = crate :: Sha256 ( Hash :: hash ( "Description hash phantom invoice" . as_bytes ( ) ) ) ;
1147
1147
let non_default_invoice_expiry_secs = 4200 ;
1148
1148
let invoice = crate :: utils:: create_phantom_invoice_with_description_hash :: <
1149
- EnforcingSigner , & test_utils:: TestKeysInterface , & test_utils:: TestLogger ,
1149
+ & test_utils:: TestKeysInterface , & test_utils:: TestLogger ,
1150
1150
> (
1151
1151
Some ( payment_amt) , None , non_default_invoice_expiry_secs, description_hash,
1152
1152
route_hints, & nodes[ 1 ] . keys_manager , & nodes[ 1 ] . logger , Currency :: BitcoinTestnet
@@ -1461,7 +1461,7 @@ mod test {
1461
1461
. map ( |route_hint| route_hint. phantom_scid )
1462
1462
. collect :: < HashSet < u64 > > ( ) ;
1463
1463
1464
- 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 ( ) ;
1464
+ 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 ( ) ;
1465
1465
1466
1466
let invoice_hints = invoice. private_routes ( ) ;
1467
1467
0 commit comments