Skip to content

Commit d94227c

Browse files
committed
Qualify the BOLT 12 unsigned invoice type
A previous commit qualified the BOLT 12 invoice type, so any related types should be similarly qualified, if public.
1 parent f8c9b09 commit d94227c

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

fuzz/src/invoice_request_deser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use lightning::blinded_path::BlindedPath;
1414
use lightning::sign::EntropySource;
1515
use lightning::ln::PaymentHash;
1616
use lightning::ln::features::BlindedHopFeatures;
17-
use lightning::offers::invoice::{BlindedPayInfo, UnsignedInvoice};
17+
use lightning::offers::invoice::{BlindedPayInfo, UnsignedBolt12Invoice};
1818
use lightning::offers::invoice_request::InvoiceRequest;
1919
use lightning::offers::parse::SemanticError;
2020
use lightning::util::ser::Writeable;
@@ -71,7 +71,7 @@ fn privkey(byte: u8) -> SecretKey {
7171

7272
fn build_response<'a, T: secp256k1::Signing + secp256k1::Verification>(
7373
invoice_request: &'a InvoiceRequest, secp_ctx: &Secp256k1<T>
74-
) -> Result<UnsignedInvoice<'a>, SemanticError> {
74+
) -> Result<UnsignedBolt12Invoice<'a>, SemanticError> {
7575
let entropy_source = Randomness {};
7676
let paths = vec![
7777
BlindedPath::new_for_message(&[pubkey(43), pubkey(44), pubkey(42)], &entropy_source, secp_ctx).unwrap(),

fuzz/src/refund_deser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use lightning::blinded_path::BlindedPath;
1414
use lightning::sign::EntropySource;
1515
use lightning::ln::PaymentHash;
1616
use lightning::ln::features::BlindedHopFeatures;
17-
use lightning::offers::invoice::{BlindedPayInfo, UnsignedInvoice};
17+
use lightning::offers::invoice::{BlindedPayInfo, UnsignedBolt12Invoice};
1818
use lightning::offers::parse::SemanticError;
1919
use lightning::offers::refund::Refund;
2020
use lightning::util::ser::Writeable;
@@ -60,7 +60,7 @@ fn privkey(byte: u8) -> SecretKey {
6060

6161
fn build_response<'a, T: secp256k1::Signing + secp256k1::Verification>(
6262
refund: &'a Refund, signing_pubkey: PublicKey, secp_ctx: &Secp256k1<T>
63-
) -> Result<UnsignedInvoice<'a>, SemanticError> {
63+
) -> Result<UnsignedBolt12Invoice<'a>, SemanticError> {
6464
let entropy_source = Randomness {};
6565
let paths = vec![
6666
BlindedPath::new_for_message(&[pubkey(43), pubkey(44), pubkey(42)], &entropy_source, secp_ctx).unwrap(),

lightning/src/offers/invoice.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -330,16 +330,16 @@ impl<'a, S: SigningPubkeyStrategy> InvoiceBuilder<'a, S> {
330330

331331
impl<'a> InvoiceBuilder<'a, ExplicitSigningPubkey> {
332332
/// Builds an unsigned [`Bolt12Invoice`] after checking for valid semantics. It can be signed by
333-
/// [`UnsignedInvoice::sign`].
334-
pub fn build(self) -> Result<UnsignedInvoice<'a>, SemanticError> {
333+
/// [`UnsignedBolt12Invoice::sign`].
334+
pub fn build(self) -> Result<UnsignedBolt12Invoice<'a>, SemanticError> {
335335
#[cfg(feature = "std")] {
336336
if self.invoice.is_offer_or_refund_expired() {
337337
return Err(SemanticError::AlreadyExpired);
338338
}
339339
}
340340

341341
let InvoiceBuilder { invreq_bytes, invoice, .. } = self;
342-
Ok(UnsignedInvoice { invreq_bytes, invoice })
342+
Ok(UnsignedBolt12Invoice { invreq_bytes, invoice })
343343
}
344344
}
345345

@@ -355,7 +355,7 @@ impl<'a> InvoiceBuilder<'a, DerivedSigningPubkey> {
355355
}
356356

357357
let InvoiceBuilder { invreq_bytes, invoice, keys, .. } = self;
358-
let unsigned_invoice = UnsignedInvoice { invreq_bytes, invoice };
358+
let unsigned_invoice = UnsignedBolt12Invoice { invreq_bytes, invoice };
359359

360360
let keys = keys.unwrap();
361361
let invoice = unsigned_invoice
@@ -366,12 +366,12 @@ impl<'a> InvoiceBuilder<'a, DerivedSigningPubkey> {
366366
}
367367

368368
/// A semantically valid [`Bolt12Invoice`] that hasn't been signed.
369-
pub struct UnsignedInvoice<'a> {
369+
pub struct UnsignedBolt12Invoice<'a> {
370370
invreq_bytes: &'a Vec<u8>,
371371
invoice: InvoiceContents,
372372
}
373373

374-
impl<'a> UnsignedInvoice<'a> {
374+
impl<'a> UnsignedBolt12Invoice<'a> {
375375
/// The public key corresponding to the key needed to sign the invoice.
376376
pub fn signing_pubkey(&self) -> PublicKey {
377377
self.invoice.fields().signing_pubkey

0 commit comments

Comments
 (0)