Skip to content

Commit 900a1d1

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. Signed-off-by: Vincenzo Palazzo <[email protected]>
1 parent 06fb142 commit 900a1d1

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

lightning/src/offers/invoice_request.rs

+6-1
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
}
@@ -874,6 +874,11 @@ impl InvoiceRequest {
874874
InvoiceWithExplicitSigningPubkeyBuilder
875875
);
876876
invoice_request_verify_method!(self, &Self);
877+
878+
#[allow(unused)] // TODO: remove this once we remove the `async_payments` cfg flag
879+
pub(super) fn bytes(&self) -> &Vec<u8> {
880+
&self.bytes
881+
}
877882
}
878883

879884
impl InvoiceRequest {

lightning/src/offers/mod.rs

-1
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

-1
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

+1
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)