]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Make offers module public
authorJeffrey Czyz <jkczyz@gmail.com>
Thu, 19 Jan 2023 16:10:38 +0000 (10:10 -0600)
committerJeffrey Czyz <jkczyz@gmail.com>
Fri, 3 Feb 2023 21:23:43 +0000 (15:23 -0600)
This is needed in order to fuzz test BOLT 12 message deserialization.

lightning/src/lib.rs
lightning/src/offers/invoice.rs
lightning/src/offers/invoice_request.rs
lightning/src/offers/offer.rs
lightning/src/offers/refund.rs
lightning/src/util/ser_macros.rs

index d4289d07d2e7a7678936ce06eaa7b51a03b2d2b3..71f82ed01340bbeb85546aa435a22e81c9381e4d 100644 (file)
@@ -78,8 +78,7 @@ extern crate core;
 pub mod util;
 pub mod chain;
 pub mod ln;
-#[allow(unused)]
-mod offers;
+pub mod offers;
 pub mod routing;
 pub mod onion_message;
 
index ad59bf35b0c9c2cd2cf54b7d19297471e757d099..2d4b57d1a242eeb1023f0b17f1b2152cf13f2d15 100644 (file)
@@ -16,7 +16,7 @@
 //! The payment recipient must include a [`PaymentHash`], so as to reveal the preimage upon payment
 //! receipt, and one or more [`BlindedPath`]s for the payer to use when sending the payment.
 //!
-//! ```ignore
+//! ```
 //! extern crate bitcoin;
 //! extern crate lightning;
 //!
@@ -1462,7 +1462,7 @@ mod tests {
                        .build().unwrap();
 
                // Only standard addresses will be included.
-               let mut fallbacks = unsigned_invoice.invoice.fields_mut().fallbacks.as_mut().unwrap();
+               let fallbacks = unsigned_invoice.invoice.fields_mut().fallbacks.as_mut().unwrap();
                // Non-standard addresses
                fallbacks.push(FallbackAddress { version: 1, program: vec![0u8; 41] });
                fallbacks.push(FallbackAddress { version: 2, program: vec![0u8; 1] });
index b0a8540b2a70a28409547f49d5926adbfe73e941..578b0a2398e5aee05410a97b5d06250ca8f52e23 100644 (file)
@@ -19,7 +19,7 @@
 //! [`Invoice`]: crate::offers::invoice::Invoice
 //! [`Refund`]: crate::offers::refund::Refund
 //!
-//! ```ignore
+//! ```
 //! extern crate bitcoin;
 //! extern crate lightning;
 //!
index a2008b6a0b5a0899e47c09c495829fd6a567bfd4..a535b378250afbd335bf790680c3f157f75d042c 100644 (file)
@@ -13,7 +13,7 @@
 //! published as a QR code to be scanned by a customer. The customer uses the offer to request an
 //! invoice from the merchant to be paid.
 //!
-//! ```ignore
+//! ```
 //! extern crate bitcoin;
 //! extern crate core;
 //! extern crate lightning;
index d64f19db06a9c479f583975283577d0cbbde38b5..1488fbe97e13ea0f0d8b10856f1e010820c444ea 100644 (file)
@@ -18,7 +18,7 @@
 //! [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
 //! [`Offer`]: crate::offers::offer::Offer
 //!
-//! ```ignore
+//! ```
 //! extern crate bitcoin;
 //! extern crate core;
 //! extern crate lightning;
index 373a64e3e0e935d8a63b499041ac1f47064fbc76..2dd764022cd63a2a253910fac4be5be1d8c77ed9 100644 (file)
@@ -378,7 +378,6 @@ macro_rules! decode_tlv_stream_with_custom_tlv_decode {
 macro_rules! _decode_tlv_stream_range {
        ($stream: expr, $range: expr, $rewind: ident, {$(($type: expr, $field: ident, $fieldty: tt)),* $(,)*}
         $(, $decode_custom_tlv: expr)?) => { {
-               use core::ops::RangeBounds;
                use $crate::ln::msgs::DecodeError;
                let mut last_seen_type: Option<u64> = None;
                let mut stream_ref = $stream;
@@ -401,7 +400,7 @@ macro_rules! _decode_tlv_stream_range {
                                                }
                                        },
                                        Err(e) => return Err(e),
-                                       Ok(t) => if $range.contains(&t.0) { t } else {
+                                       Ok(t) => if core::ops::RangeBounds::contains(&$range, &t.0) { t } else {
                                                drop(tracking_reader);
 
                                                // Assumes the type id is minimally encoded, which is enforced on read.