Skip to content

Commit a7da722

Browse files
committed
Rename VerifiedInvoiceRequest to VerifiedInvoiceRequestLegacy
In the upcoming commits, we will be phasing the current style of VerifiedInvoiceRequest, in favour of newer version. To keep the changes modular, and clean we rename the current VerifiedInvoiceRequest to VerifiedInvoiceRequestLegacy.
1 parent 5ceb625 commit a7da722

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

lightning/src/offers/flow.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ use crate::offers::invoice::{
4141
};
4242
use crate::offers::invoice_error::InvoiceError;
4343
use crate::offers::invoice_request::{
44-
InvoiceRequest, InvoiceRequestBuilder, VerifiedInvoiceRequest,
44+
InvoiceRequest, InvoiceRequestBuilder, VerifiedInvoiceRequestLegacy,
4545
};
4646
use crate::offers::nonce::Nonce;
4747
use crate::offers::offer::{DerivedMetadata, Offer, OfferBuilder};
@@ -406,7 +406,7 @@ fn enqueue_onion_message_with_reply_paths<T: OnionMessageContents + Clone>(
406406
pub enum InvreqResponseInstructions {
407407
/// We are the recipient of this payment, and a [`Bolt12Invoice`] should be sent in response to
408408
/// the invoice request since it is now verified.
409-
SendInvoice(VerifiedInvoiceRequest),
409+
SendInvoice(VerifiedInvoiceRequestLegacy),
410410
/// We are a static invoice server and should respond to this invoice request by retrieving the
411411
/// [`StaticInvoice`] corresponding to the `recipient_id` and `invoice_id` and calling
412412
/// `OffersMessageFlow::enqueue_static_invoice`.
@@ -920,7 +920,7 @@ where
920920
Ok(builder.into())
921921
}
922922

923-
/// Creates a response for the provided [`VerifiedInvoiceRequest`].
923+
/// Creates a response for the provided [`VerifiedInvoiceRequestLegacy`].
924924
///
925925
/// A response can be either an [`OffersMessage::Invoice`] with additional [`MessageContext`],
926926
/// or an [`OffersMessage::InvoiceError`], depending on the [`InvoiceRequest`].
@@ -930,8 +930,9 @@ where
930930
/// - We fail to generate a valid signed [`Bolt12Invoice`] for the [`InvoiceRequest`].
931931
pub fn create_response_for_invoice_request<ES: Deref, NS: Deref, R: Deref>(
932932
&self, signer: &NS, router: &R, entropy_source: ES,
933-
invoice_request: VerifiedInvoiceRequest, amount_msats: u64, payment_hash: PaymentHash,
934-
payment_secret: PaymentSecret, usable_channels: Vec<ChannelDetails>,
933+
invoice_request: VerifiedInvoiceRequestLegacy, amount_msats: u64,
934+
payment_hash: PaymentHash, payment_secret: PaymentSecret,
935+
usable_channels: Vec<ChannelDetails>,
935936
) -> (OffersMessage, Option<MessageContext>)
936937
where
937938
ES::Target: EntropySource,

lightning/src/offers/invoice_request.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ pub struct InvoiceRequest {
592592
/// [`InvoiceRequest::verify_using_recipient_data`] and exposes different ways to respond depending
593593
/// on whether the signing keys were derived.
594594
#[derive(Clone, Debug)]
595-
pub struct VerifiedInvoiceRequest {
595+
pub struct VerifiedInvoiceRequestLegacy {
596596
/// The identifier of the [`Offer`] for which the [`InvoiceRequest`] was made.
597597
pub offer_id: OfferId,
598598

@@ -745,7 +745,7 @@ macro_rules! invoice_request_respond_with_explicit_signing_pubkey_methods { (
745745
///
746746
/// If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`],
747747
/// then first use [`InvoiceRequest::verify_using_metadata`] or
748-
/// [`InvoiceRequest::verify_using_recipient_data`] and then [`VerifiedInvoiceRequest`] methods
748+
/// [`InvoiceRequest::verify_using_recipient_data`] and then [`VerifiedInvoiceRequestLegacy`] methods
749749
/// instead.
750750
///
751751
/// [`Bolt12Invoice::created_at`]: crate::offers::invoice::Bolt12Invoice::created_at
@@ -801,10 +801,10 @@ macro_rules! invoice_request_verify_method {
801801
secp_ctx: &Secp256k1<T>,
802802
#[cfg(c_bindings)]
803803
secp_ctx: &Secp256k1<secp256k1::All>,
804-
) -> Result<VerifiedInvoiceRequest, ()> {
804+
) -> Result<VerifiedInvoiceRequestLegacy, ()> {
805805
let (offer_id, keys) =
806806
$self.contents.inner.offer.verify_using_metadata(&$self.bytes, key, secp_ctx)?;
807-
Ok(VerifiedInvoiceRequest {
807+
Ok(VerifiedInvoiceRequestLegacy {
808808
offer_id,
809809
#[cfg(not(c_bindings))]
810810
inner: $self,
@@ -831,11 +831,11 @@ macro_rules! invoice_request_verify_method {
831831
secp_ctx: &Secp256k1<T>,
832832
#[cfg(c_bindings)]
833833
secp_ctx: &Secp256k1<secp256k1::All>,
834-
) -> Result<VerifiedInvoiceRequest, ()> {
834+
) -> Result<VerifiedInvoiceRequestLegacy, ()> {
835835
let (offer_id, keys) = $self.contents.inner.offer.verify_using_recipient_data(
836836
&$self.bytes, nonce, key, secp_ctx
837837
)?;
838-
Ok(VerifiedInvoiceRequest {
838+
Ok(VerifiedInvoiceRequestLegacy {
839839
offer_id,
840840
#[cfg(not(c_bindings))]
841841
inner: $self,
@@ -961,7 +961,7 @@ macro_rules! invoice_request_respond_with_derived_signing_pubkey_methods { (
961961
}
962962
} }
963963

964-
impl VerifiedInvoiceRequest {
964+
impl VerifiedInvoiceRequestLegacy {
965965
offer_accessors!(self, self.inner.contents.inner.offer);
966966
invoice_request_accessors!(self, self.inner.contents);
967967
#[cfg(not(c_bindings))]

0 commit comments

Comments
 (0)