Skip to content

Commit 153d831

Browse files
committed
Make offers module public
This is needed in order to fuzz test BOLT 12 message deserialization.
1 parent 6388c9a commit 153d831

File tree

6 files changed

+7
-9
lines changed

6 files changed

+7
-9
lines changed

lightning/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ extern crate core;
7878
pub mod util;
7979
pub mod chain;
8080
pub mod ln;
81-
#[allow(unused)]
82-
mod offers;
81+
pub mod offers;
8382
pub mod routing;
8483
pub mod onion_message;
8584

lightning/src/offers/invoice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//! The payment recipient must include a [`PaymentHash`], so as to reveal the preimage upon payment
1717
//! receipt, and one or more [`BlindedPath`]s for the payer to use when sending the payment.
1818
//!
19-
//! ```ignore
19+
//! ```
2020
//! extern crate bitcoin;
2121
//! extern crate lightning;
2222
//!
@@ -1462,7 +1462,7 @@ mod tests {
14621462
.build().unwrap();
14631463

14641464
// Only standard addresses will be included.
1465-
let mut fallbacks = unsigned_invoice.invoice.fields_mut().fallbacks.as_mut().unwrap();
1465+
let fallbacks = unsigned_invoice.invoice.fields_mut().fallbacks.as_mut().unwrap();
14661466
// Non-standard addresses
14671467
fallbacks.push(FallbackAddress { version: 1, program: vec![0u8; 41] });
14681468
fallbacks.push(FallbackAddress { version: 2, program: vec![0u8; 1] });

lightning/src/offers/invoice_request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
//! [`Invoice`]: crate::offers::invoice::Invoice
2020
//! [`Refund`]: crate::offers::refund::Refund
2121
//!
22-
//! ```ignore
22+
//! ```
2323
//! extern crate bitcoin;
2424
//! extern crate lightning;
2525
//!

lightning/src/offers/offer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//! published as a QR code to be scanned by a customer. The customer uses the offer to request an
1414
//! invoice from the merchant to be paid.
1515
//!
16-
//! ```ignore
16+
//! ```
1717
//! extern crate bitcoin;
1818
//! extern crate core;
1919
//! extern crate lightning;

lightning/src/offers/refund.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
//! [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
1919
//! [`Offer`]: crate::offers::offer::Offer
2020
//!
21-
//! ```ignore
21+
//! ```
2222
//! extern crate bitcoin;
2323
//! extern crate core;
2424
//! extern crate lightning;

lightning/src/util/ser_macros.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,6 @@ macro_rules! decode_tlv_stream_with_custom_tlv_decode {
378378
macro_rules! _decode_tlv_stream_range {
379379
($stream: expr, $range: expr, $rewind: ident, {$(($type: expr, $field: ident, $fieldty: tt)),* $(,)*}
380380
$(, $decode_custom_tlv: expr)?) => { {
381-
use core::ops::RangeBounds;
382381
use $crate::ln::msgs::DecodeError;
383382
let mut last_seen_type: Option<u64> = None;
384383
let mut stream_ref = $stream;
@@ -401,7 +400,7 @@ macro_rules! _decode_tlv_stream_range {
401400
}
402401
},
403402
Err(e) => return Err(e),
404-
Ok(t) => if $range.contains(&t.0) { t } else {
403+
Ok(t) => if core::ops::RangeBounds::contains(&$range, &t.0) { t } else {
405404
drop(tracking_reader);
406405

407406
// Assumes the type id is minimally encoded, which is enforced on read.

0 commit comments

Comments
 (0)