Skip to content

Commit 442585b

Browse files
valentinewallacevincenzopalazzo
authored andcommitted
Un-cfg-gate StaticInvoices
We need to include static invoices in the public API as part of the onion messages we're adding for static invoice server support. Utilities to create these static invoices and other parts of the async receive API will remain cfg-gated for now. Generally, we can't totally avoid exposing half baked async receive support in the public API because OnionMessenger is parameterized by an async payments message handler, which can't be cfg-gated easily.
1 parent c114a9f commit 442585b

File tree

4 files changed

+2
-3
lines changed

4 files changed

+2
-3
lines changed

lightning/src/offers/invoice_request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ impl InvoiceRequest {
858858
);
859859
invoice_request_verify_method!(self, Self);
860860

861-
#[cfg(async_payments)]
861+
#[allow(unused)] // TODO: remove this once we remove the `async_payments` cfg flag
862862
pub(super) fn bytes(&self) -> &Vec<u8> {
863863
&self.bytes
864864
}

lightning/src/offers/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pub mod parse;
2525
mod payer;
2626
pub mod refund;
2727
pub(crate) mod signer;
28-
#[cfg(async_payments)]
2928
pub mod static_invoice;
3029
#[cfg(test)]
3130
pub(crate) mod test_utils;

lightning/src/offers/offer.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,6 @@ impl Offer {
743743
.chain(TlvStream::new(bytes).range(EXPERIMENTAL_OFFER_TYPES))
744744
}
745745

746-
#[cfg(async_payments)]
747746
pub(super) fn verify<T: secp256k1::Signing>(
748747
&self, nonce: Nonce, key: &ExpandedKey, secp_ctx: &Secp256k1<T>,
749748
) -> Result<(OfferId, Option<Keypair>), ()> {

lightning/src/offers/static_invoice.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ impl StaticInvoice {
379379
self.signature
380380
}
381381

382+
#[allow(unused)] // TODO: remove this once we remove the `async_payments` cfg flag
382383
pub(crate) fn from_same_offer(&self, invreq: &InvoiceRequest) -> bool {
383384
let invoice_offer_tlv_stream =
384385
Offer::tlv_stream_iter(&self.bytes).map(|tlv_record| tlv_record.record_bytes);

0 commit comments

Comments
 (0)