From: Matt Corallo Date: Wed, 1 Mar 2023 00:21:51 +0000 (+0000) Subject: Make the `offers` module non-public X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=a2e4077724184a09aa491c06dbd0e87d06558d92;p=rust-lightning Make the `offers` module non-public As the `offers` types in LDK are currently only practically useful for VLS users, there's no need to rush to get them included in bindings, and sadly some tweaks to the bindings generator are required for them. For now, its simpler to just make them non-public. --- diff --git a/lightning/src/lib.rs b/lightning/src/lib.rs index 71f82ed01..b1d14e863 100644 --- a/lightning/src/lib.rs +++ b/lightning/src/lib.rs @@ -78,7 +78,7 @@ extern crate core; pub mod util; pub mod chain; pub mod ln; -pub mod offers; +pub(crate) mod offers; pub mod routing; pub mod onion_message; diff --git a/lightning/src/offers/offer.rs b/lightning/src/offers/offer.rs index 405e2e278..62505d27b 100644 --- a/lightning/src/offers/offer.rs +++ b/lightning/src/offers/offer.rs @@ -536,15 +536,12 @@ pub enum Amount { /// An amount of currency specified using ISO 4712. Currency { /// The currency that the amount is denominated in. - iso4217_code: CurrencyCode, + iso4217_code: [u8; 3], /// The amount in the currency unit adjusted by the ISO 4712 exponent (e.g., USD cents). amount: u64, }, } -/// An ISO 4712 three-letter currency code (e.g., USD). -pub type CurrencyCode = [u8; 3]; - /// Quantity of items supported by an [`Offer`]. #[derive(Clone, Copy, Debug, PartialEq)] pub enum Quantity { @@ -573,7 +570,7 @@ impl Quantity { tlv_stream!(OfferTlvStream, OfferTlvStreamRef, 1..80, { (2, chains: (Vec, WithoutLength)), (4, metadata: (Vec, WithoutLength)), - (6, currency: CurrencyCode), + (6, currency: [u8; 3]), (8, amount: (u64, HighZeroBytesDroppedBigSize)), (10, description: (String, WithoutLength)), (12, features: (OfferFeatures, WithoutLength)),