Skip to content

Commit 827da23

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 ac8f897 commit 827da23

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::{Amount, DerivedMetadata, Offer, OfferBuilder};
@@ -393,7 +393,7 @@ fn enqueue_onion_message_with_reply_paths<T: OnionMessageContents + Clone>(
393393
pub enum InvreqResponseInstructions {
394394
/// We are the recipient of this payment, and a [`Bolt12Invoice`] should be sent in response to
395395
/// the invoice request since it is now verified.
396-
SendInvoice(VerifiedInvoiceRequest),
396+
SendInvoice(VerifiedInvoiceRequestLegacy),
397397
/// We are a static invoice server and should respond to this invoice request by retrieving the
398398
/// [`StaticInvoice`] corresponding to the `recipient_id` and `invoice_id` and calling
399399
/// `OffersMessageFlow::enqueue_static_invoice`.
@@ -902,7 +902,7 @@ where
902902
Ok(builder.into())
903903
}
904904

905-
/// Creates a response for the provided [`VerifiedInvoiceRequest`].
905+
/// Creates a response for the provided [`VerifiedInvoiceRequestLegacy`].
906906
///
907907
/// A response can be either an [`OffersMessage::Invoice`] with additional [`MessageContext`],
908908
/// or an [`OffersMessage::InvoiceError`], depending on the [`InvoiceRequest`].
@@ -912,8 +912,9 @@ where
912912
/// - We fail to generate a valid signed [`Bolt12Invoice`] for the [`InvoiceRequest`].
913913
pub fn create_response_for_invoice_request<ES: Deref, NS: Deref, R: Deref>(
914914
&self, signer: &NS, router: &R, entropy_source: ES,
915-
invoice_request: VerifiedInvoiceRequest, amount_msats: u64, payment_hash: PaymentHash,
916-
payment_secret: PaymentSecret, usable_channels: Vec<ChannelDetails>,
915+
invoice_request: VerifiedInvoiceRequestLegacy, amount_msats: u64,
916+
payment_hash: PaymentHash, payment_secret: PaymentSecret,
917+
usable_channels: Vec<ChannelDetails>,
917918
) -> (OffersMessage, Option<MessageContext>)
918919
where
919920
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)