Add some no-exporting of more offers code
authorMatt Corallo <git@bluematt.me>
Tue, 25 Apr 2023 17:40:40 +0000 (17:40 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 3 Oct 2023 23:22:29 +0000 (23:22 +0000)
These really could be handled in the bindings, but for lack of
immediate users there's not a strong reason to, so instead we just
disable them for now.

lightning/src/offers/invoice.rs
lightning/src/offers/offer.rs
lightning/src/offers/parse.rs

index 908d2d4bee6d2f6b9091ae0d62ce7e650cbfe754..74bc5944b0eca8252d4e65482c312ec390e116c7 100644 (file)
@@ -312,6 +312,8 @@ impl<'a, S: SigningPubkeyStrategy> InvoiceBuilder<'a, S> {
        ///
        /// Successive calls to this method will add another address. Caller is responsible for not
        /// adding duplicate addresses and only calling if capable of receiving to P2TR addresses.
+       ///
+       /// This is not exported to bindings users as TweakedPublicKey isn't yet mapped.
        pub fn fallback_v1_p2tr_tweaked(mut self, output_key: &TweakedPublicKey) -> Self {
                let address = FallbackAddress {
                        version: WitnessVersion::V1.to_num(),
@@ -664,6 +666,8 @@ macro_rules! invoice_accessors { ($self: ident, $contents: expr) => {
 
        /// Fallback addresses for paying the invoice on-chain, in order of most-preferred to
        /// least-preferred.
+       ///
+       /// This is not exported to bindings users as Address is not yet mapped
        pub fn fallbacks(&$self) -> Vec<Address> {
                $contents.fallbacks()
        }
index 60621b9dc7491686fbf3207a532f0e2bc25a5aa5..dbda0585f8d6fec60fbb34d658c9ceeec28fad55 100644 (file)
@@ -737,6 +737,9 @@ pub enum Amount {
        /// An amount of currency specified using ISO 4712.
        Currency {
                /// The currency that the amount is denominated in.
+               ///
+               /// This is not exported to bindings users as bindings have troubles with type aliases to
+               /// byte arrays.
                iso4217_code: CurrencyCode,
                /// The amount in the currency unit adjusted by the ISO 4712 exponent (e.g., USD cents).
                amount: u64,
@@ -744,7 +747,7 @@ pub enum Amount {
 }
 
 /// An ISO 4712 three-letter currency code (e.g., USD).
-pub type CurrencyCode = [u8; 3];
+pub(crate) type CurrencyCode = [u8; 3];
 
 /// Quantity of items supported by an [`Offer`].
 #[derive(Clone, Copy, Debug, PartialEq)]
@@ -754,7 +757,8 @@ pub enum Quantity {
        ///
        /// May be used with `NonZeroU64::new(1)` but prefer to use [`Quantity::One`] if only one item
        /// is supported.
-       Bounded(NonZeroU64),
+       Bounded(/// This is not exported to bindings users as builder patterns don't map outside of move semantics.
+               NonZeroU64),
        /// One or more items. Use when more than one item can be requested without any limit.
        Unbounded,
        /// Only one item. Use when only a single item can be requested.
index e9477086ee981358aea419416e676e4b682c1fc1..cb61af1db01abb263afdb7c5513fa5c52f411dda 100644 (file)
@@ -125,7 +125,8 @@ pub enum Bolt12ParseError {
        /// being parsed.
        InvalidBech32Hrp,
        /// The string could not be bech32 decoded.
-       Bech32(bech32::Error),
+       Bech32(/// This is not exported to bindings users as the details don't matter much
+               bech32::Error),
        /// The bech32 decoded string could not be decoded as the expected message type.
        Decode(DecodeError),
        /// The parsed message has invalid semantics.