@@ -150,8 +150,8 @@ pub struct RefundMaybeWithDerivedMetadataBuilder<'a> {
150150}
151151
152152macro_rules! refund_explicit_metadata_builder_methods { ( ) => {
153- /// Creates a new builder for a refund using the [`Refund::payer_id`] for the public node id to
154- /// send to if no [`Refund::paths`] are set. Otherwise, it may be a transient pubkey.
153+ /// Creates a new builder for a refund using the `signing_pubkey` for the public node id to send
154+ /// to if no [`Refund::paths`] are set. Otherwise, `signing_pubkey` may be a transient pubkey.
155155 ///
156156 /// Additionally, sets the required (empty) [`Refund::description`], [`Refund::payer_metadata`],
157157 /// and [`Refund::amount_msats`].
@@ -164,7 +164,7 @@ macro_rules! refund_explicit_metadata_builder_methods { () => {
164164 /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
165165 /// [`ChannelManager::create_refund_builder`]: crate::ln::channelmanager::ChannelManager::create_refund_builder
166166 pub fn new(
167- metadata: Vec <u8 >, payer_id : PublicKey , amount_msats: u64
167+ metadata: Vec <u8 >, signing_pubkey : PublicKey , amount_msats: u64
168168 ) -> Result <Self , Bolt12SemanticError > {
169169 if amount_msats > MAX_VALUE_MSAT {
170170 return Err ( Bolt12SemanticError :: InvalidAmount ) ;
@@ -175,7 +175,7 @@ macro_rules! refund_explicit_metadata_builder_methods { () => {
175175 refund: RefundContents {
176176 payer: PayerContents ( metadata) , description: String :: new( ) , absolute_expiry: None ,
177177 issuer: None , chain: None , amount_msats, features: InvoiceRequestFeatures :: empty( ) ,
178- quantity: None , payer_id , payer_note: None , paths: None ,
178+ quantity: None , payer_signing_pubkey : signing_pubkey , payer_note: None , paths: None ,
179179 } ,
180180 secp_ctx: None ,
181181 } )
@@ -202,7 +202,7 @@ macro_rules! refund_builder_methods { (
202202 /// [`Bolt12Invoice::verify_using_metadata`]: crate::offers::invoice::Bolt12Invoice::verify_using_metadata
203203 /// [`Bolt12Invoice::verify_using_payer_data`]: crate::offers::invoice::Bolt12Invoice::verify_using_payer_data
204204 /// [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
205- pub fn deriving_payer_id (
205+ pub fn deriving_signing_pubkey (
206206 node_id: PublicKey , expanded_key: & ExpandedKey , nonce: Nonce ,
207207 secp_ctx: & ' a Secp256k1 <$secp_context>, amount_msats: u64 , payment_id: PaymentId
208208 ) -> Result <Self , Bolt12SemanticError > {
@@ -217,7 +217,7 @@ macro_rules! refund_builder_methods { (
217217 refund: RefundContents {
218218 payer: PayerContents ( metadata) , description: String :: new( ) , absolute_expiry: None ,
219219 issuer: None , chain: None , amount_msats, features: InvoiceRequestFeatures :: empty( ) ,
220- quantity: None , payer_id : node_id, payer_note: None , paths: None ,
220+ quantity: None , payer_signing_pubkey : node_id, payer_note: None , paths: None ,
221221 } ,
222222 secp_ctx: Some ( secp_ctx) ,
223223 } )
@@ -249,7 +249,7 @@ macro_rules! refund_builder_methods { (
249249 }
250250
251251 /// Adds a blinded path to [`Refund::paths`]. Must include at least one path if only connected
252- /// by private channels or if [`Refund::payer_id `] is not a public node id.
252+ /// by private channels or if [`Refund::payer_signing_pubkey `] is not a public node id.
253253 ///
254254 /// Successive calls to this method will add another blinded path. Caller is responsible for not
255255 /// adding duplicate paths.
@@ -324,7 +324,7 @@ macro_rules! refund_builder_methods { (
324324 metadata. derive_from( iv_bytes, tlv_stream, $self. secp_ctx) ;
325325 metadata = derived_metadata;
326326 if let Some ( keys) = keys {
327- $self. refund. payer_id = keys. public_key( ) ;
327+ $self. refund. payer_signing_pubkey = keys. public_key( ) ;
328328 }
329329
330330 $self. refund. payer. 0 = metadata;
@@ -434,7 +434,7 @@ pub(super) struct RefundContents {
434434 amount_msats : u64 ,
435435 features : InvoiceRequestFeatures ,
436436 quantity : Option < u64 > ,
437- payer_id : PublicKey ,
437+ payer_signing_pubkey : PublicKey ,
438438 payer_note : Option < String > ,
439439 paths : Option < Vec < BlindedMessagePath > > ,
440440}
@@ -477,9 +477,9 @@ impl Refund {
477477 }
478478
479479 /// An unpredictable series of bytes, typically containing information about the derivation of
480- /// [`payer_id `].
480+ /// [`payer_signing_pubkey `].
481481 ///
482- /// [`payer_id `]: Self::payer_id
482+ /// [`payer_signing_pubkey `]: Self::payer_signing_pubkey
483483 pub fn payer_metadata ( & self ) -> & [ u8 ] {
484484 self . contents . metadata ( )
485485 }
@@ -510,8 +510,8 @@ impl Refund {
510510 /// transient pubkey.
511511 ///
512512 /// [`paths`]: Self::paths
513- pub fn payer_id ( & self ) -> PublicKey {
514- self . contents . payer_id ( )
513+ pub fn payer_signing_pubkey ( & self ) -> PublicKey {
514+ self . contents . payer_signing_pubkey ( )
515515 }
516516
517517 /// Payer provided note to include in the invoice.
@@ -727,8 +727,8 @@ impl RefundContents {
727727 /// transient pubkey.
728728 ///
729729 /// [`paths`]: Self::paths
730- pub fn payer_id ( & self ) -> PublicKey {
731- self . payer_id
730+ pub fn payer_signing_pubkey ( & self ) -> PublicKey {
731+ self . payer_signing_pubkey
732732 }
733733
734734 /// Payer provided note to include in the invoice.
@@ -765,7 +765,7 @@ impl RefundContents {
765765 amount : Some ( self . amount_msats ) ,
766766 features,
767767 quantity : self . quantity ,
768- payer_id : Some ( & self . payer_id ) ,
768+ payer_id : Some ( & self . payer_signing_pubkey ) ,
769769 payer_note : self . payer_note . as_ref ( ) ,
770770 paths : self . paths . as_ref ( ) ,
771771 } ;
@@ -901,14 +901,14 @@ impl TryFrom<RefundTlvStream> for RefundContents {
901901
902902 let features = features. unwrap_or_else ( InvoiceRequestFeatures :: empty) ;
903903
904- let payer_id = match payer_id {
904+ let payer_signing_pubkey = match payer_id {
905905 None => return Err ( Bolt12SemanticError :: MissingPayerSigningPubkey ) ,
906906 Some ( payer_id) => payer_id,
907907 } ;
908908
909909 Ok ( RefundContents {
910910 payer, description, absolute_expiry, issuer, chain, amount_msats, features, quantity,
911- payer_id , payer_note, paths,
911+ payer_signing_pubkey , payer_note, paths,
912912 } )
913913 }
914914}
@@ -985,7 +985,7 @@ mod tests {
985985 assert_eq ! ( refund. chain( ) , ChainHash :: using_genesis_block( Network :: Bitcoin ) ) ;
986986 assert_eq ! ( refund. amount_msats( ) , 1000 ) ;
987987 assert_eq ! ( refund. features( ) , & InvoiceRequestFeatures :: empty( ) ) ;
988- assert_eq ! ( refund. payer_id ( ) , payer_pubkey( ) ) ;
988+ assert_eq ! ( refund. payer_signing_pubkey ( ) , payer_pubkey( ) ) ;
989989 assert_eq ! ( refund. payer_note( ) , None ) ;
990990
991991 assert_eq ! (
@@ -1040,10 +1040,10 @@ mod tests {
10401040 let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
10411041
10421042 let refund = RefundBuilder
1043- :: deriving_payer_id ( node_id, & expanded_key, nonce, & secp_ctx, 1000 , payment_id)
1043+ :: deriving_signing_pubkey ( node_id, & expanded_key, nonce, & secp_ctx, 1000 , payment_id)
10441044 . unwrap ( )
10451045 . build ( ) . unwrap ( ) ;
1046- assert_eq ! ( refund. payer_id ( ) , node_id) ;
1046+ assert_eq ! ( refund. payer_signing_pubkey ( ) , node_id) ;
10471047
10481048 // Fails verification with altered fields
10491049 let invoice = refund
@@ -1089,7 +1089,7 @@ mod tests {
10891089 }
10901090
10911091 #[ test]
1092- fn builds_refund_with_derived_payer_id ( ) {
1092+ fn builds_refund_with_derived_signing_pubkey ( ) {
10931093 let node_id = payer_pubkey ( ) ;
10941094 let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
10951095 let entropy = FixedEntropy { } ;
@@ -1106,11 +1106,11 @@ mod tests {
11061106 ) ;
11071107
11081108 let refund = RefundBuilder
1109- :: deriving_payer_id ( node_id, & expanded_key, nonce, & secp_ctx, 1000 , payment_id)
1109+ :: deriving_signing_pubkey ( node_id, & expanded_key, nonce, & secp_ctx, 1000 , payment_id)
11101110 . unwrap ( )
11111111 . path ( blinded_path)
11121112 . build ( ) . unwrap ( ) ;
1113- assert_ne ! ( refund. payer_id ( ) , node_id) ;
1113+ assert_ne ! ( refund. payer_signing_pubkey ( ) , node_id) ;
11141114
11151115 let invoice = refund
11161116 . respond_with_no_std ( payment_paths ( ) , payment_hash ( ) , recipient_pubkey ( ) , now ( ) )
@@ -1211,7 +1211,7 @@ mod tests {
12111211 . build ( )
12121212 . unwrap ( ) ;
12131213 let ( _, _, invoice_request_tlv_stream) = refund. as_tlv_stream ( ) ;
1214- assert_eq ! ( refund. payer_id ( ) , pubkey( 42 ) ) ;
1214+ assert_eq ! ( refund. payer_signing_pubkey ( ) , pubkey( 42 ) ) ;
12151215 assert_eq ! ( refund. paths( ) , paths. as_slice( ) ) ;
12161216 assert_ne ! ( pubkey( 42 ) , pubkey( 44 ) ) ;
12171217 assert_eq ! ( invoice_request_tlv_stream. payer_id, Some ( & pubkey( 42 ) ) ) ;
0 commit comments