@@ -352,20 +352,20 @@ fn _create_invoice_from_channelmanager_and_duration_since_epoch<M: Deref, T: Der
352352 . create_inbound_payment ( amt_msat, invoice_expiry_delta_secs)
353353 . map_err ( |( ) | SignOrCreationError :: CreationError ( CreationError :: InvalidAmount ) ) ?;
354354 _create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash (
355- channelmanager, keys_manager, logger, network, amt_msat, description, duration_since_epoch, invoice_expiry_delta_secs, payment_hash, payment_secret)
355+ channelmanager, keys_manager, logger, network, amt_msat, description, duration_since_epoch, invoice_expiry_delta_secs, payment_hash, payment_secret, secp_context )
356356}
357357
358358/// See [`create_invoice_from_channelmanager_and_duration_since_epoch`]
359359/// This version allows for providing a custom [`PaymentHash`] for the invoice.
360360/// This may be useful if you're building an on-chain swap or involving another protocol where
361361/// the payment hash is also involved outside the scope of lightning.
362- pub fn create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash < M : Deref , T : Deref , K : Deref , F : Deref , L : Deref > (
362+ pub fn create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash < M : Deref , T : Deref , K : Deref , F : Deref , L : Deref , C : Signing > (
363363 channelmanager : & ChannelManager < M , T , K , F , L > , keys_manager : K , logger : L ,
364364 network : Currency , amt_msat : Option < u64 > , description : String , duration_since_epoch : Duration ,
365- invoice_expiry_delta_secs : u32 , payment_hash : PaymentHash
365+ invoice_expiry_delta_secs : u32 , payment_hash : PaymentHash , secp_context : & Secp256k1 < C >
366366) -> Result < Invoice , SignOrCreationError < ( ) > >
367367 where
368- M :: Target : chain:: Watch < <K :: Target as KeysInterface >:: Signer > ,
368+ M :: Target : chain:: Watch < <K :: Target as SignerProvider >:: Signer > ,
369369 T :: Target : BroadcasterInterface ,
370370 K :: Target : KeysInterface ,
371371 F :: Target : FeeEstimator ,
@@ -379,21 +379,22 @@ pub fn create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_
379379 InvoiceDescription :: Direct (
380380 & Description :: new ( description) . map_err ( SignOrCreationError :: CreationError ) ?,
381381 ) ,
382- duration_since_epoch, invoice_expiry_delta_secs, payment_hash, payment_secret
382+ duration_since_epoch, invoice_expiry_delta_secs, payment_hash, payment_secret, secp_context
383383 )
384384}
385385
386- fn _create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash < M : Deref , T : Deref , K : Deref , F : Deref , L : Deref > (
386+ fn _create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash < M : Deref , T : Deref , K : Deref , F : Deref , L : Deref , C : Signing > (
387387 channelmanager : & ChannelManager < M , T , K , F , L > , keys_manager : K , logger : L ,
388388 network : Currency , amt_msat : Option < u64 > , description : InvoiceDescription , duration_since_epoch : Duration ,
389- invoice_expiry_delta_secs : u32 , payment_hash : PaymentHash , payment_secret : PaymentSecret
389+ invoice_expiry_delta_secs : u32 , payment_hash : PaymentHash , payment_secret : PaymentSecret ,
390+ secp_context : & Secp256k1 < C >
390391) -> Result < Invoice , SignOrCreationError < ( ) > >
391392 where
392- M :: Target : chain:: Watch < <K :: Target as KeysInterface >:: Signer > ,
393+ M :: Target : chain:: Watch < <K :: Target as SignerProvider >:: Signer > ,
393394 T :: Target : BroadcasterInterface ,
394395 K :: Target : KeysInterface ,
395396 F :: Target : FeeEstimator ,
396- L :: Target : Logger ,
397+ L :: Target : Logger
397398{
398399 let our_node_pubkey = channelmanager. get_our_node_id ( ) ;
399400 let channels = channelmanager. list_channels ( ) ;
@@ -723,10 +724,11 @@ mod test {
723724 let nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
724725 let payment_hash = PaymentHash ( [ 0 ; 32 ] ) ;
725726 let payment_secret = & nodes[ 1 ] . node . create_inbound_payment_for_hash ( payment_hash, Some ( 10_000 ) , 3600 ) ;
727+ let secp_context = Secp256k1 :: signing_only ( ) ;
726728 let invoice = crate :: utils:: create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash (
727729 & nodes[ 1 ] . node , nodes[ 1 ] . keys_manager , nodes[ 1 ] . logger , Currency :: BitcoinTestnet ,
728730 Some ( 10_000 ) , "test" . to_string ( ) , Duration :: from_secs ( 1234567 ) , 3600 ,
729- payment_hash
731+ payment_hash, & secp_context
730732 ) . unwrap ( ) ;
731733 assert_eq ! ( invoice. amount_pico_btc( ) , Some ( 100_000 ) ) ;
732734 assert_eq ! ( invoice. min_final_cltv_expiry( ) , MIN_FINAL_CLTV_EXPIRY as u64 ) ;
0 commit comments