@@ -150,8 +150,8 @@ pub struct RefundMaybeWithDerivedMetadataBuilder<'a> {
150
150
}
151
151
152
152
macro_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.
155
155
///
156
156
/// Additionally, sets the required (empty) [`Refund::description`], [`Refund::payer_metadata`],
157
157
/// and [`Refund::amount_msats`].
@@ -164,7 +164,7 @@ macro_rules! refund_explicit_metadata_builder_methods { () => {
164
164
/// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
165
165
/// [`ChannelManager::create_refund_builder`]: crate::ln::channelmanager::ChannelManager::create_refund_builder
166
166
pub fn new(
167
- metadata: Vec <u8 >, payer_id : PublicKey , amount_msats: u64
167
+ metadata: Vec <u8 >, signing_pubkey : PublicKey , amount_msats: u64
168
168
) -> Result <Self , Bolt12SemanticError > {
169
169
if amount_msats > MAX_VALUE_MSAT {
170
170
return Err ( Bolt12SemanticError :: InvalidAmount ) ;
@@ -175,7 +175,7 @@ macro_rules! refund_explicit_metadata_builder_methods { () => {
175
175
refund: RefundContents {
176
176
payer: PayerContents ( metadata) , description: String :: new( ) , absolute_expiry: None ,
177
177
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 ,
179
179
} ,
180
180
secp_ctx: None ,
181
181
} )
@@ -202,7 +202,7 @@ macro_rules! refund_builder_methods { (
202
202
/// [`Bolt12Invoice::verify_using_metadata`]: crate::offers::invoice::Bolt12Invoice::verify_using_metadata
203
203
/// [`Bolt12Invoice::verify_using_payer_data`]: crate::offers::invoice::Bolt12Invoice::verify_using_payer_data
204
204
/// [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
205
- pub fn deriving_payer_id (
205
+ pub fn deriving_signing_pubkey (
206
206
node_id: PublicKey , expanded_key: & ExpandedKey , nonce: Nonce ,
207
207
secp_ctx: & ' a Secp256k1 <$secp_context>, amount_msats: u64 , payment_id: PaymentId
208
208
) -> Result <Self , Bolt12SemanticError > {
@@ -217,7 +217,7 @@ macro_rules! refund_builder_methods { (
217
217
refund: RefundContents {
218
218
payer: PayerContents ( metadata) , description: String :: new( ) , absolute_expiry: None ,
219
219
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 ,
221
221
} ,
222
222
secp_ctx: Some ( secp_ctx) ,
223
223
} )
@@ -249,7 +249,7 @@ macro_rules! refund_builder_methods { (
249
249
}
250
250
251
251
/// 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.
253
253
///
254
254
/// Successive calls to this method will add another blinded path. Caller is responsible for not
255
255
/// adding duplicate paths.
@@ -324,7 +324,7 @@ macro_rules! refund_builder_methods { (
324
324
metadata. derive_from( iv_bytes, tlv_stream, $self. secp_ctx) ;
325
325
metadata = derived_metadata;
326
326
if let Some ( keys) = keys {
327
- $self. refund. payer_id = keys. public_key( ) ;
327
+ $self. refund. payer_signing_pubkey = keys. public_key( ) ;
328
328
}
329
329
330
330
$self. refund. payer. 0 = metadata;
@@ -434,7 +434,7 @@ pub(super) struct RefundContents {
434
434
amount_msats : u64 ,
435
435
features : InvoiceRequestFeatures ,
436
436
quantity : Option < u64 > ,
437
- payer_id : PublicKey ,
437
+ payer_signing_pubkey : PublicKey ,
438
438
payer_note : Option < String > ,
439
439
paths : Option < Vec < BlindedMessagePath > > ,
440
440
}
@@ -477,9 +477,9 @@ impl Refund {
477
477
}
478
478
479
479
/// An unpredictable series of bytes, typically containing information about the derivation of
480
- /// [`payer_id `].
480
+ /// [`payer_signing_pubkey `].
481
481
///
482
- /// [`payer_id `]: Self::payer_id
482
+ /// [`payer_signing_pubkey `]: Self::payer_signing_pubkey
483
483
pub fn payer_metadata ( & self ) -> & [ u8 ] {
484
484
self . contents . metadata ( )
485
485
}
@@ -510,8 +510,8 @@ impl Refund {
510
510
/// transient pubkey.
511
511
///
512
512
/// [`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 ( )
515
515
}
516
516
517
517
/// Payer provided note to include in the invoice.
@@ -727,8 +727,8 @@ impl RefundContents {
727
727
/// transient pubkey.
728
728
///
729
729
/// [`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
732
732
}
733
733
734
734
/// Payer provided note to include in the invoice.
@@ -765,7 +765,7 @@ impl RefundContents {
765
765
amount : Some ( self . amount_msats ) ,
766
766
features,
767
767
quantity : self . quantity ,
768
- payer_id : Some ( & self . payer_id ) ,
768
+ payer_id : Some ( & self . payer_signing_pubkey ) ,
769
769
payer_note : self . payer_note . as_ref ( ) ,
770
770
paths : self . paths . as_ref ( ) ,
771
771
} ;
@@ -901,14 +901,14 @@ impl TryFrom<RefundTlvStream> for RefundContents {
901
901
902
902
let features = features. unwrap_or_else ( InvoiceRequestFeatures :: empty) ;
903
903
904
- let payer_id = match payer_id {
904
+ let payer_signing_pubkey = match payer_id {
905
905
None => return Err ( Bolt12SemanticError :: MissingPayerSigningPubkey ) ,
906
906
Some ( payer_id) => payer_id,
907
907
} ;
908
908
909
909
Ok ( RefundContents {
910
910
payer, description, absolute_expiry, issuer, chain, amount_msats, features, quantity,
911
- payer_id , payer_note, paths,
911
+ payer_signing_pubkey , payer_note, paths,
912
912
} )
913
913
}
914
914
}
@@ -985,7 +985,7 @@ mod tests {
985
985
assert_eq ! ( refund. chain( ) , ChainHash :: using_genesis_block( Network :: Bitcoin ) ) ;
986
986
assert_eq ! ( refund. amount_msats( ) , 1000 ) ;
987
987
assert_eq ! ( refund. features( ) , & InvoiceRequestFeatures :: empty( ) ) ;
988
- assert_eq ! ( refund. payer_id ( ) , payer_pubkey( ) ) ;
988
+ assert_eq ! ( refund. payer_signing_pubkey ( ) , payer_pubkey( ) ) ;
989
989
assert_eq ! ( refund. payer_note( ) , None ) ;
990
990
991
991
assert_eq ! (
@@ -1040,10 +1040,10 @@ mod tests {
1040
1040
let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
1041
1041
1042
1042
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)
1044
1044
. unwrap ( )
1045
1045
. build ( ) . unwrap ( ) ;
1046
- assert_eq ! ( refund. payer_id ( ) , node_id) ;
1046
+ assert_eq ! ( refund. payer_signing_pubkey ( ) , node_id) ;
1047
1047
1048
1048
// Fails verification with altered fields
1049
1049
let invoice = refund
@@ -1089,7 +1089,7 @@ mod tests {
1089
1089
}
1090
1090
1091
1091
#[ test]
1092
- fn builds_refund_with_derived_payer_id ( ) {
1092
+ fn builds_refund_with_derived_signing_pubkey ( ) {
1093
1093
let node_id = payer_pubkey ( ) ;
1094
1094
let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
1095
1095
let entropy = FixedEntropy { } ;
@@ -1106,11 +1106,11 @@ mod tests {
1106
1106
) ;
1107
1107
1108
1108
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)
1110
1110
. unwrap ( )
1111
1111
. path ( blinded_path)
1112
1112
. build ( ) . unwrap ( ) ;
1113
- assert_ne ! ( refund. payer_id ( ) , node_id) ;
1113
+ assert_ne ! ( refund. payer_signing_pubkey ( ) , node_id) ;
1114
1114
1115
1115
let invoice = refund
1116
1116
. respond_with_no_std ( payment_paths ( ) , payment_hash ( ) , recipient_pubkey ( ) , now ( ) )
@@ -1211,7 +1211,7 @@ mod tests {
1211
1211
. build ( )
1212
1212
. unwrap ( ) ;
1213
1213
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 ) ) ;
1215
1215
assert_eq ! ( refund. paths( ) , paths. as_slice( ) ) ;
1216
1216
assert_ne ! ( pubkey( 42 ) , pubkey( 44 ) ) ;
1217
1217
assert_eq ! ( invoice_request_tlv_stream. payer_id, Some ( & pubkey( 42 ) ) ) ;
0 commit comments