@@ -487,14 +487,16 @@ macro_rules! invoice_accessors { ($self: ident, $contents: expr) => {
487
487
/// From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
488
488
///
489
489
/// [`Offer::chains`]: crate::offers::offer::Offer::chains
490
- pub fn chains ( & $self) -> Option <Vec <ChainHash >> {
491
- $contents. chains ( )
490
+ pub fn offer_chains ( & $self) -> Option <Vec <ChainHash >> {
491
+ $contents. offer_chains ( )
492
492
}
493
493
494
- /// A chain that the originating offer or refund is valid for.
494
+ /// The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
495
+ /// invoice originated from an offer.
495
496
///
496
497
/// From [`InvoiceRequest::chain`] or [`Refund::chain`].
497
498
///
499
+ /// [`offer_chains`]: Self::offer_chains
498
500
/// [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
499
501
pub fn chain( & $self) -> ChainHash {
500
502
$contents. chain( )
@@ -565,8 +567,8 @@ macro_rules! invoice_accessors { ($self: ident, $contents: expr) => {
565
567
/// From [`Offer::paths`] or [`Refund::paths`].
566
568
///
567
569
/// [`Offer::paths`]: crate::offers::offer::Offer::paths
568
- pub fn paths ( & $self) -> & [ BlindedPath ] {
569
- $contents. paths ( )
570
+ pub fn message_paths ( & $self) -> & [ BlindedPath ] {
571
+ $contents. message_paths ( )
570
572
}
571
573
572
574
/// The quantity of items supported.
@@ -601,9 +603,9 @@ macro_rules! invoice_accessors { ($self: ident, $contents: expr) => {
601
603
}
602
604
603
605
/// A possibly transient pubkey used to sign the invoice request or to send an invoice for a
604
- /// refund in case there are no [`paths `].
606
+ /// refund in case there are no [`message_paths `].
605
607
///
606
- /// [`paths `]: Self::paths
608
+ /// [`message_paths `]: Self::message_paths
607
609
pub fn payer_id( & $self) -> PublicKey {
608
610
$contents. payer_id( )
609
611
}
@@ -718,7 +720,7 @@ impl InvoiceContents {
718
720
}
719
721
}
720
722
721
- fn chains ( & self ) -> Option < Vec < ChainHash > > {
723
+ fn offer_chains ( & self ) -> Option < Vec < ChainHash > > {
722
724
match self {
723
725
InvoiceContents :: ForOffer { invoice_request, .. } =>
724
726
Some ( invoice_request. inner . offer . chains ( ) ) ,
@@ -785,7 +787,7 @@ impl InvoiceContents {
785
787
}
786
788
}
787
789
788
- fn paths ( & self ) -> & [ BlindedPath ] {
790
+ fn message_paths ( & self ) -> & [ BlindedPath ] {
789
791
match self {
790
792
InvoiceContents :: ForOffer { invoice_request, .. } => {
791
793
invoice_request. inner . offer . paths ( )
@@ -1330,13 +1332,13 @@ mod tests {
1330
1332
1331
1333
assert_eq ! ( unsigned_invoice. bytes, buffer. as_slice( ) ) ;
1332
1334
assert_eq ! ( unsigned_invoice. payer_metadata( ) , & [ 1 ; 32 ] ) ;
1333
- assert_eq ! ( unsigned_invoice. chains ( ) , Some ( vec![ ChainHash :: using_genesis_block( Network :: Bitcoin ) ] ) ) ;
1335
+ assert_eq ! ( unsigned_invoice. offer_chains ( ) , Some ( vec![ ChainHash :: using_genesis_block( Network :: Bitcoin ) ] ) ) ;
1334
1336
assert_eq ! ( unsigned_invoice. metadata( ) , None ) ;
1335
1337
assert_eq ! ( unsigned_invoice. amount( ) , Some ( & Amount :: Bitcoin { amount_msats: 1000 } ) ) ;
1336
1338
assert_eq ! ( unsigned_invoice. description( ) , PrintableString ( "foo" ) ) ;
1337
1339
assert_eq ! ( unsigned_invoice. offer_features( ) , Some ( & OfferFeatures :: empty( ) ) ) ;
1338
1340
assert_eq ! ( unsigned_invoice. absolute_expiry( ) , None ) ;
1339
- assert_eq ! ( unsigned_invoice. paths ( ) , & [ ] ) ;
1341
+ assert_eq ! ( unsigned_invoice. message_paths ( ) , & [ ] ) ;
1340
1342
assert_eq ! ( unsigned_invoice. issuer( ) , None ) ;
1341
1343
assert_eq ! ( unsigned_invoice. supported_quantity( ) , Some ( Quantity :: One ) ) ;
1342
1344
assert_eq ! ( unsigned_invoice. signing_pubkey( ) , recipient_pubkey( ) ) ;
@@ -1372,13 +1374,13 @@ mod tests {
1372
1374
1373
1375
assert_eq ! ( invoice. bytes, buffer. as_slice( ) ) ;
1374
1376
assert_eq ! ( invoice. payer_metadata( ) , & [ 1 ; 32 ] ) ;
1375
- assert_eq ! ( invoice. chains ( ) , Some ( vec![ ChainHash :: using_genesis_block( Network :: Bitcoin ) ] ) ) ;
1377
+ assert_eq ! ( invoice. offer_chains ( ) , Some ( vec![ ChainHash :: using_genesis_block( Network :: Bitcoin ) ] ) ) ;
1376
1378
assert_eq ! ( invoice. metadata( ) , None ) ;
1377
1379
assert_eq ! ( invoice. amount( ) , Some ( & Amount :: Bitcoin { amount_msats: 1000 } ) ) ;
1378
1380
assert_eq ! ( invoice. description( ) , PrintableString ( "foo" ) ) ;
1379
1381
assert_eq ! ( invoice. offer_features( ) , Some ( & OfferFeatures :: empty( ) ) ) ;
1380
1382
assert_eq ! ( invoice. absolute_expiry( ) , None ) ;
1381
- assert_eq ! ( invoice. paths ( ) , & [ ] ) ;
1383
+ assert_eq ! ( invoice. message_paths ( ) , & [ ] ) ;
1382
1384
assert_eq ! ( invoice. issuer( ) , None ) ;
1383
1385
assert_eq ! ( invoice. supported_quantity( ) , Some ( Quantity :: One ) ) ;
1384
1386
assert_eq ! ( invoice. signing_pubkey( ) , recipient_pubkey( ) ) ;
@@ -1471,13 +1473,13 @@ mod tests {
1471
1473
1472
1474
assert_eq ! ( invoice. bytes, buffer. as_slice( ) ) ;
1473
1475
assert_eq ! ( invoice. payer_metadata( ) , & [ 1 ; 32 ] ) ;
1474
- assert_eq ! ( invoice. chains ( ) , None ) ;
1476
+ assert_eq ! ( invoice. offer_chains ( ) , None ) ;
1475
1477
assert_eq ! ( invoice. metadata( ) , None ) ;
1476
1478
assert_eq ! ( invoice. amount( ) , None ) ;
1477
1479
assert_eq ! ( invoice. description( ) , PrintableString ( "foo" ) ) ;
1478
1480
assert_eq ! ( invoice. offer_features( ) , None ) ;
1479
1481
assert_eq ! ( invoice. absolute_expiry( ) , None ) ;
1480
- assert_eq ! ( invoice. paths ( ) , & [ ] ) ;
1482
+ assert_eq ! ( invoice. message_paths ( ) , & [ ] ) ;
1481
1483
assert_eq ! ( invoice. issuer( ) , None ) ;
1482
1484
assert_eq ! ( invoice. supported_quantity( ) , None ) ;
1483
1485
assert_eq ! ( invoice. signing_pubkey( ) , recipient_pubkey( ) ) ;
0 commit comments