@@ -77,7 +77,7 @@ struct InvoiceContents {
77
77
fallbacks : Option < Vec < FallbackAddress > > ,
78
78
features : Bolt12InvoiceFeatures ,
79
79
signing_pubkey : PublicKey ,
80
- async_receive_message_paths : Vec < BlindedPath > ,
80
+ async_receive_paths : Vec < BlindedPath > ,
81
81
}
82
82
83
83
/// Builds a [`StaticInvoice`] from an [`Offer`].
@@ -98,17 +98,14 @@ impl<'a> StaticInvoiceBuilder<'a> {
98
98
/// after `created_at`.
99
99
pub fn for_offer_using_derived_keys < T : secp256k1:: Signing > (
100
100
offer : & ' a Offer , payment_paths : Vec < ( BlindedPayInfo , BlindedPath ) > ,
101
- async_receive_message_paths : Vec < BlindedPath > , created_at : Duration ,
102
- expanded_key : & ExpandedKey , secp_ctx : & Secp256k1 < T > ,
101
+ async_receive_paths : Vec < BlindedPath > , created_at : Duration , expanded_key : & ExpandedKey ,
102
+ secp_ctx : & Secp256k1 < T > ,
103
103
) -> Result < Self , Bolt12SemanticError > {
104
104
if offer. chains ( ) . len ( ) > 1 {
105
105
return Err ( Bolt12SemanticError :: UnexpectedChain ) ;
106
106
}
107
107
108
- if payment_paths. is_empty ( )
109
- || async_receive_message_paths. is_empty ( )
110
- || offer. paths ( ) . is_empty ( )
111
- {
108
+ if payment_paths. is_empty ( ) || async_receive_paths. is_empty ( ) || offer. paths ( ) . is_empty ( ) {
112
109
return Err ( Bolt12SemanticError :: MissingPaths ) ;
113
110
}
114
111
@@ -129,7 +126,7 @@ impl<'a> StaticInvoiceBuilder<'a> {
129
126
let invoice = InvoiceContents :: new (
130
127
offer,
131
128
payment_paths,
132
- async_receive_message_paths ,
129
+ async_receive_paths ,
133
130
created_at,
134
131
signing_pubkey,
135
132
) ;
@@ -238,8 +235,8 @@ macro_rules! invoice_accessors { ($self: ident, $contents: expr) => {
238
235
239
236
/// Paths to the recipient for indicating that a held HTLC is available to claim when they next
240
237
/// come online.
241
- pub fn async_receive_message_paths ( & $self) -> & [ BlindedPath ] {
242
- $contents. async_receive_message_paths ( )
238
+ pub fn async_receive_paths ( & $self) -> & [ BlindedPath ] {
239
+ $contents. async_receive_paths ( )
243
240
}
244
241
245
242
/// The quantity of items supported, from [`Offer::supported_quantity`].
@@ -335,13 +332,12 @@ impl InvoiceContents {
335
332
336
333
fn new (
337
334
offer : & Offer , payment_paths : Vec < ( BlindedPayInfo , BlindedPath ) > ,
338
- async_receive_message_paths : Vec < BlindedPath > , created_at : Duration ,
339
- signing_pubkey : PublicKey ,
335
+ async_receive_paths : Vec < BlindedPath > , created_at : Duration , signing_pubkey : PublicKey ,
340
336
) -> Self {
341
337
Self {
342
338
offer : offer. contents . clone ( ) ,
343
339
payment_paths,
344
- async_receive_message_paths ,
340
+ async_receive_paths ,
345
341
created_at,
346
342
relative_expiry : None ,
347
343
fallbacks : None ,
@@ -361,7 +357,7 @@ impl InvoiceContents {
361
357
362
358
let invoice = InvoiceTlvStreamRef {
363
359
paths : Some ( Iterable ( self . payment_paths . iter ( ) . map ( |( _, path) | path) ) ) ,
364
- invoice_message_paths : Some ( self . async_receive_message_paths . as_ref ( ) ) ,
360
+ invoice_message_paths : Some ( self . async_receive_paths . as_ref ( ) ) ,
365
361
blindedpay : Some ( Iterable ( self . payment_paths . iter ( ) . map ( |( payinfo, _) | payinfo) ) ) ,
366
362
created_at : Some ( self . created_at . as_secs ( ) ) ,
367
363
relative_expiry : self . relative_expiry . map ( |duration| duration. as_secs ( ) as u32 ) ,
@@ -408,8 +404,8 @@ impl InvoiceContents {
408
404
self . offer . paths ( )
409
405
}
410
406
411
- fn async_receive_message_paths ( & self ) -> & [ BlindedPath ] {
412
- & self . async_receive_message_paths [ ..]
407
+ fn async_receive_paths ( & self ) -> & [ BlindedPath ] {
408
+ & self . async_receive_paths [ ..]
413
409
}
414
410
415
411
fn supported_quantity ( & self ) -> Quantity {
@@ -533,8 +529,7 @@ impl TryFrom<PartialInvoiceTlvStream> for InvoiceContents {
533
529
}
534
530
535
531
let payment_paths = construct_payment_paths ( blindedpay, paths) ?;
536
- let async_receive_message_paths =
537
- invoice_message_paths. ok_or ( Bolt12SemanticError :: MissingPaths ) ?;
532
+ let async_receive_paths = invoice_message_paths. ok_or ( Bolt12SemanticError :: MissingPaths ) ?;
538
533
539
534
let created_at = match created_at {
540
535
None => return Err ( Bolt12SemanticError :: MissingCreationTime ) ,
@@ -558,7 +553,7 @@ impl TryFrom<PartialInvoiceTlvStream> for InvoiceContents {
558
553
Ok ( InvoiceContents {
559
554
offer : OfferContents :: try_from ( offer_tlv_stream) ?,
560
555
payment_paths,
561
- async_receive_message_paths ,
556
+ async_receive_paths ,
562
557
created_at,
563
558
relative_expiry,
564
559
fallbacks,
@@ -689,7 +684,7 @@ mod tests {
689
684
assert_eq ! ( invoice. offer_features( ) , & OfferFeatures :: empty( ) ) ;
690
685
assert_eq ! ( invoice. absolute_expiry( ) , None ) ;
691
686
assert_eq ! ( invoice. request_paths( ) , & [ blinded_path( ) ] ) ;
692
- assert_eq ! ( invoice. async_receive_message_paths ( ) , & [ blinded_path( ) ] ) ;
687
+ assert_eq ! ( invoice. async_receive_paths ( ) , & [ blinded_path( ) ] ) ;
693
688
assert_eq ! ( invoice. issuer( ) , None ) ;
694
689
assert_eq ! ( invoice. supported_quantity( ) , Quantity :: One ) ;
695
690
assert_ne ! ( invoice. signing_pubkey( ) , recipient_pubkey( ) ) ;
@@ -1065,8 +1060,8 @@ mod tests {
1065
1060
}
1066
1061
1067
1062
// Error if message paths are missing.
1068
- let missing_async_receive_message_paths_invoice = invoice ( ) ;
1069
- let mut tlv_stream = missing_async_receive_message_paths_invoice . as_tlv_stream ( ) ;
1063
+ let missing_async_receive_paths_invoice = invoice ( ) ;
1064
+ let mut tlv_stream = missing_async_receive_paths_invoice . as_tlv_stream ( ) ;
1070
1065
tlv_stream. 1 . invoice_message_paths = None ;
1071
1066
match StaticInvoice :: try_from ( tlv_stream_to_bytes ( & tlv_stream) ) {
1072
1067
Ok ( _) => panic ! ( "expected error" ) ,
0 commit comments