@@ -481,14 +481,16 @@ macro_rules! invoice_accessors { ($self: ident, $contents: expr) => {
481
481
/// From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
482
482
///
483
483
/// [`Offer::chains`]: crate::offers::offer::Offer::chains
484
- pub fn chains ( & $self) -> Option <Vec <ChainHash >> {
485
- $contents. chains ( )
484
+ pub fn offer_chains ( & $self) -> Option <Vec <ChainHash >> {
485
+ $contents. offer_chains ( )
486
486
}
487
487
488
- /// A chain that the originating offer or refund is valid for.
488
+ /// The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
489
+ /// invoice originated from an offer.
489
490
///
490
491
/// From [`InvoiceRequest::chain`] or [`Refund::chain`].
491
492
///
493
+ /// [`offer_chains`]: Self::offer_chains
492
494
/// [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
493
495
pub fn chain( & $self) -> ChainHash {
494
496
$contents. chain( )
@@ -559,8 +561,8 @@ macro_rules! invoice_accessors { ($self: ident, $contents: expr) => {
559
561
/// From [`Offer::paths`] or [`Refund::paths`].
560
562
///
561
563
/// [`Offer::paths`]: crate::offers::offer::Offer::paths
562
- pub fn paths ( & $self) -> & [ BlindedPath ] {
563
- $contents. paths ( )
564
+ pub fn message_paths ( & $self) -> & [ BlindedPath ] {
565
+ $contents. message_paths ( )
564
566
}
565
567
566
568
/// The quantity of items supported.
@@ -595,9 +597,9 @@ macro_rules! invoice_accessors { ($self: ident, $contents: expr) => {
595
597
}
596
598
597
599
/// A possibly transient pubkey used to sign the invoice request or to send an invoice for a
598
- /// refund in case there are no [`paths `].
600
+ /// refund in case there are no [`message_paths `].
599
601
///
600
- /// [`paths `]: Self::paths
602
+ /// [`message_paths `]: Self::message_paths
601
603
pub fn payer_id( & $self) -> PublicKey {
602
604
$contents. payer_id( )
603
605
}
@@ -712,7 +714,7 @@ impl InvoiceContents {
712
714
}
713
715
}
714
716
715
- fn chains ( & self ) -> Option < Vec < ChainHash > > {
717
+ fn offer_chains ( & self ) -> Option < Vec < ChainHash > > {
716
718
match self {
717
719
InvoiceContents :: ForOffer { invoice_request, .. } =>
718
720
Some ( invoice_request. inner . offer . chains ( ) ) ,
@@ -779,7 +781,7 @@ impl InvoiceContents {
779
781
}
780
782
}
781
783
782
- fn paths ( & self ) -> & [ BlindedPath ] {
784
+ fn message_paths ( & self ) -> & [ BlindedPath ] {
783
785
match self {
784
786
InvoiceContents :: ForOffer { invoice_request, .. } => {
785
787
invoice_request. inner . offer . paths ( )
@@ -1324,13 +1326,13 @@ mod tests {
1324
1326
1325
1327
assert_eq ! ( unsigned_invoice. bytes, buffer. as_slice( ) ) ;
1326
1328
assert_eq ! ( unsigned_invoice. payer_metadata( ) , & [ 1 ; 32 ] ) ;
1327
- assert_eq ! ( unsigned_invoice. chains ( ) , Some ( vec![ ChainHash :: using_genesis_block( Network :: Bitcoin ) ] ) ) ;
1329
+ assert_eq ! ( unsigned_invoice. offer_chains ( ) , Some ( vec![ ChainHash :: using_genesis_block( Network :: Bitcoin ) ] ) ) ;
1328
1330
assert_eq ! ( unsigned_invoice. metadata( ) , None ) ;
1329
1331
assert_eq ! ( unsigned_invoice. amount( ) , Some ( & Amount :: Bitcoin { amount_msats: 1000 } ) ) ;
1330
1332
assert_eq ! ( unsigned_invoice. description( ) , PrintableString ( "foo" ) ) ;
1331
1333
assert_eq ! ( unsigned_invoice. offer_features( ) , Some ( & OfferFeatures :: empty( ) ) ) ;
1332
1334
assert_eq ! ( unsigned_invoice. absolute_expiry( ) , None ) ;
1333
- assert_eq ! ( unsigned_invoice. paths ( ) , & [ ] ) ;
1335
+ assert_eq ! ( unsigned_invoice. message_paths ( ) , & [ ] ) ;
1334
1336
assert_eq ! ( unsigned_invoice. issuer( ) , None ) ;
1335
1337
assert_eq ! ( unsigned_invoice. supported_quantity( ) , Some ( Quantity :: One ) ) ;
1336
1338
assert_eq ! ( unsigned_invoice. signing_pubkey( ) , recipient_pubkey( ) ) ;
@@ -1366,13 +1368,13 @@ mod tests {
1366
1368
1367
1369
assert_eq ! ( invoice. bytes, buffer. as_slice( ) ) ;
1368
1370
assert_eq ! ( invoice. payer_metadata( ) , & [ 1 ; 32 ] ) ;
1369
- assert_eq ! ( invoice. chains ( ) , Some ( vec![ ChainHash :: using_genesis_block( Network :: Bitcoin ) ] ) ) ;
1371
+ assert_eq ! ( invoice. offer_chains ( ) , Some ( vec![ ChainHash :: using_genesis_block( Network :: Bitcoin ) ] ) ) ;
1370
1372
assert_eq ! ( invoice. metadata( ) , None ) ;
1371
1373
assert_eq ! ( invoice. amount( ) , Some ( & Amount :: Bitcoin { amount_msats: 1000 } ) ) ;
1372
1374
assert_eq ! ( invoice. description( ) , PrintableString ( "foo" ) ) ;
1373
1375
assert_eq ! ( invoice. offer_features( ) , Some ( & OfferFeatures :: empty( ) ) ) ;
1374
1376
assert_eq ! ( invoice. absolute_expiry( ) , None ) ;
1375
- assert_eq ! ( invoice. paths ( ) , & [ ] ) ;
1377
+ assert_eq ! ( invoice. message_paths ( ) , & [ ] ) ;
1376
1378
assert_eq ! ( invoice. issuer( ) , None ) ;
1377
1379
assert_eq ! ( invoice. supported_quantity( ) , Some ( Quantity :: One ) ) ;
1378
1380
assert_eq ! ( invoice. signing_pubkey( ) , recipient_pubkey( ) ) ;
@@ -1465,13 +1467,13 @@ mod tests {
1465
1467
1466
1468
assert_eq ! ( invoice. bytes, buffer. as_slice( ) ) ;
1467
1469
assert_eq ! ( invoice. payer_metadata( ) , & [ 1 ; 32 ] ) ;
1468
- assert_eq ! ( invoice. chains ( ) , None ) ;
1470
+ assert_eq ! ( invoice. offer_chains ( ) , None ) ;
1469
1471
assert_eq ! ( invoice. metadata( ) , None ) ;
1470
1472
assert_eq ! ( invoice. amount( ) , None ) ;
1471
1473
assert_eq ! ( invoice. description( ) , PrintableString ( "foo" ) ) ;
1472
1474
assert_eq ! ( invoice. offer_features( ) , None ) ;
1473
1475
assert_eq ! ( invoice. absolute_expiry( ) , None ) ;
1474
- assert_eq ! ( invoice. paths ( ) , & [ ] ) ;
1476
+ assert_eq ! ( invoice. message_paths ( ) , & [ ] ) ;
1475
1477
assert_eq ! ( invoice. issuer( ) , None ) ;
1476
1478
assert_eq ! ( invoice. supported_quantity( ) , None ) ;
1477
1479
assert_eq ! ( invoice. signing_pubkey( ) , recipient_pubkey( ) ) ;
0 commit comments