use lightning::sign::EntropySource;
use lightning::ln::PaymentHash;
use lightning::ln::features::BlindedHopFeatures;
-use lightning::offers::invoice::{BlindedPayInfo, UnsignedInvoice};
+use lightning::offers::invoice::{BlindedPayInfo, UnsignedBolt12Invoice};
use lightning::offers::invoice_request::InvoiceRequest;
use lightning::offers::parse::SemanticError;
use lightning::util::ser::Writeable;
fn build_response<'a, T: secp256k1::Signing + secp256k1::Verification>(
invoice_request: &'a InvoiceRequest, secp_ctx: &Secp256k1<T>
-) -> Result<UnsignedInvoice<'a>, SemanticError> {
+) -> Result<UnsignedBolt12Invoice<'a>, SemanticError> {
let entropy_source = Randomness {};
let paths = vec![
BlindedPath::new_for_message(&[pubkey(43), pubkey(44), pubkey(42)], &entropy_source, secp_ctx).unwrap(),
use lightning::sign::EntropySource;
use lightning::ln::PaymentHash;
use lightning::ln::features::BlindedHopFeatures;
-use lightning::offers::invoice::{BlindedPayInfo, UnsignedInvoice};
+use lightning::offers::invoice::{BlindedPayInfo, UnsignedBolt12Invoice};
use lightning::offers::parse::SemanticError;
use lightning::offers::refund::Refund;
use lightning::util::ser::Writeable;
fn build_response<'a, T: secp256k1::Signing + secp256k1::Verification>(
refund: &'a Refund, signing_pubkey: PublicKey, secp_ctx: &Secp256k1<T>
-) -> Result<UnsignedInvoice<'a>, SemanticError> {
+) -> Result<UnsignedBolt12Invoice<'a>, SemanticError> {
let entropy_source = Randomness {};
let paths = vec![
BlindedPath::new_for_message(&[pubkey(43), pubkey(44), pubkey(42)], &entropy_source, secp_ctx).unwrap(),
impl<'a> InvoiceBuilder<'a, ExplicitSigningPubkey> {
/// Builds an unsigned [`Bolt12Invoice`] after checking for valid semantics. It can be signed by
- /// [`UnsignedInvoice::sign`].
- pub fn build(self) -> Result<UnsignedInvoice<'a>, SemanticError> {
+ /// [`UnsignedBolt12Invoice::sign`].
+ pub fn build(self) -> Result<UnsignedBolt12Invoice<'a>, SemanticError> {
#[cfg(feature = "std")] {
if self.invoice.is_offer_or_refund_expired() {
return Err(SemanticError::AlreadyExpired);
}
let InvoiceBuilder { invreq_bytes, invoice, .. } = self;
- Ok(UnsignedInvoice { invreq_bytes, invoice })
+ Ok(UnsignedBolt12Invoice { invreq_bytes, invoice })
}
}
}
let InvoiceBuilder { invreq_bytes, invoice, keys, .. } = self;
- let unsigned_invoice = UnsignedInvoice { invreq_bytes, invoice };
+ let unsigned_invoice = UnsignedBolt12Invoice { invreq_bytes, invoice };
let keys = keys.unwrap();
let invoice = unsigned_invoice
}
/// A semantically valid [`Bolt12Invoice`] that hasn't been signed.
-pub struct UnsignedInvoice<'a> {
+pub struct UnsignedBolt12Invoice<'a> {
invreq_bytes: &'a Vec<u8>,
invoice: InvoiceContents,
}
-impl<'a> UnsignedInvoice<'a> {
+impl<'a> UnsignedBolt12Invoice<'a> {
/// The public key corresponding to the key needed to sign the invoice.
pub fn signing_pubkey(&self) -> PublicKey {
self.invoice.fields().signing_pubkey