Skip to content

Commit 78e03fa

Browse files
f request_paths -> offer_request_paths rename
1 parent 807c9e2 commit 78e03fa

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

lightning/src/offers/invoice.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -690,8 +690,8 @@ macro_rules! invoice_accessors { ($self: ident, $contents: expr) => {
690690
/// From [`Offer::paths`] or [`Refund::paths`].
691691
///
692692
/// [`Offer::paths`]: crate::offers::offer::Offer::paths
693-
pub fn request_paths(&$self) -> &[BlindedPath] {
694-
$contents.request_paths()
693+
pub fn offer_request_paths(&$self) -> &[BlindedPath] {
694+
$contents.offer_request_paths()
695695
}
696696

697697
/// The quantity of items supported.
@@ -726,9 +726,9 @@ macro_rules! invoice_accessors { ($self: ident, $contents: expr) => {
726726
}
727727

728728
/// A possibly transient pubkey used to sign the invoice request or to send an invoice for a
729-
/// refund in case there are no [`request_paths`].
729+
/// refund in case there are no [`offer_request_paths`].
730730
///
731-
/// [`request_paths`]: Self::request_paths
731+
/// [`offer_request_paths`]: Self::offer_request_paths
732732
pub fn payer_id(&$self) -> PublicKey {
733733
$contents.payer_id()
734734
}
@@ -891,7 +891,7 @@ impl InvoiceContents {
891891
}
892892
}
893893

894-
fn request_paths(&self) -> &[BlindedPath] {
894+
fn offer_request_paths(&self) -> &[BlindedPath] {
895895
match self {
896896
InvoiceContents::ForOffer { invoice_request, .. } => {
897897
invoice_request.inner.offer.paths()
@@ -1475,7 +1475,7 @@ mod tests {
14751475
assert_eq!(unsigned_invoice.description(), Some(PrintableString("")));
14761476
assert_eq!(unsigned_invoice.offer_features(), Some(&OfferFeatures::empty()));
14771477
assert_eq!(unsigned_invoice.absolute_expiry(), None);
1478-
assert_eq!(unsigned_invoice.request_paths(), &[]);
1478+
assert_eq!(unsigned_invoice.offer_request_paths(), &[]);
14791479
assert_eq!(unsigned_invoice.issuer(), None);
14801480
assert_eq!(unsigned_invoice.supported_quantity(), Some(Quantity::One));
14811481
assert_eq!(unsigned_invoice.signing_pubkey(), recipient_pubkey());
@@ -1517,7 +1517,7 @@ mod tests {
15171517
assert_eq!(invoice.description(), Some(PrintableString("")));
15181518
assert_eq!(invoice.offer_features(), Some(&OfferFeatures::empty()));
15191519
assert_eq!(invoice.absolute_expiry(), None);
1520-
assert_eq!(invoice.request_paths(), &[]);
1520+
assert_eq!(invoice.offer_request_paths(), &[]);
15211521
assert_eq!(invoice.issuer(), None);
15221522
assert_eq!(invoice.supported_quantity(), Some(Quantity::One));
15231523
assert_eq!(invoice.signing_pubkey(), recipient_pubkey());
@@ -1614,7 +1614,7 @@ mod tests {
16141614
assert_eq!(invoice.description(), Some(PrintableString("")));
16151615
assert_eq!(invoice.offer_features(), None);
16161616
assert_eq!(invoice.absolute_expiry(), None);
1617-
assert_eq!(invoice.request_paths(), &[]);
1617+
assert_eq!(invoice.offer_request_paths(), &[]);
16181618
assert_eq!(invoice.issuer(), None);
16191619
assert_eq!(invoice.supported_quantity(), None);
16201620
assert_eq!(invoice.signing_pubkey(), recipient_pubkey());

lightning/src/offers/static_invoice.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ macro_rules! invoice_accessors { ($self: ident, $contents: expr) => {
224224
/// publicly reachable nodes. Taken from [`Offer::paths`].
225225
///
226226
/// [`Offer::paths`]: crate::offers::offer::Offer::paths
227-
pub fn request_paths(&$self) -> &[BlindedPath] {
228-
$contents.request_paths()
227+
pub fn offer_request_paths(&$self) -> &[BlindedPath] {
228+
$contents.offer_request_paths()
229229
}
230230

231231
/// Paths to the recipient for indicating that a held HTLC is available to claim when they next
@@ -395,7 +395,7 @@ impl InvoiceContents {
395395
self.offer.issuer()
396396
}
397397

398-
fn request_paths(&self) -> &[BlindedPath] {
398+
fn offer_request_paths(&self) -> &[BlindedPath] {
399399
self.offer.paths()
400400
}
401401

@@ -678,7 +678,7 @@ mod tests {
678678
assert_eq!(invoice.description(), None);
679679
assert_eq!(invoice.offer_features(), &OfferFeatures::empty());
680680
assert_eq!(invoice.absolute_expiry(), None);
681-
assert_eq!(invoice.request_paths(), &[blinded_path()]);
681+
assert_eq!(invoice.offer_request_paths(), &[blinded_path()]);
682682
assert_eq!(invoice.message_paths(), &[blinded_path()]);
683683
assert_eq!(invoice.issuer(), None);
684684
assert_eq!(invoice.supported_quantity(), Quantity::One);
@@ -1137,8 +1137,8 @@ mod tests {
11371137
#[test]
11381138
fn fails_parsing_invoice_with_invalid_offer_fields() {
11391139
// Error if the offer is missing paths.
1140-
let missing_request_paths_invoice = invoice();
1141-
let mut tlv_stream = missing_request_paths_invoice.as_tlv_stream();
1140+
let missing_offer_request_paths_invoice = invoice();
1141+
let mut tlv_stream = missing_offer_request_paths_invoice.as_tlv_stream();
11421142
tlv_stream.0.paths = None;
11431143
match StaticInvoice::try_from(tlv_stream_to_bytes(&tlv_stream)) {
11441144
Ok(_) => panic!("expected error"),

0 commit comments

Comments
 (0)