Skip to content

Commit 8d7615b

Browse files
committed
Add some no-exporting of more offers code
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.
1 parent 57819c2 commit 8d7615b

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

lightning/src/offers/invoice.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ impl<'a, S: SigningPubkeyStrategy> InvoiceBuilder<'a, S> {
311311
///
312312
/// Successive calls to this method will add another address. Caller is responsible for not
313313
/// adding duplicate addresses and only calling if capable of receiving to P2TR addresses.
314+
///
315+
/// This is not exported to bindings users as TweakedPublicKey isn't yet mapped.
314316
pub fn fallback_v1_p2tr_tweaked(mut self, output_key: &TweakedPublicKey) -> Self {
315317
let address = FallbackAddress {
316318
version: WitnessVersion::V1.to_num(),
@@ -476,6 +478,8 @@ impl Invoice {
476478
///
477479
/// Blinded paths provide recipient privacy by obfuscating its node id. Note, however, that this
478480
/// privacy is lost if a public node id is used for [`Invoice::signing_pubkey`].
481+
///
482+
/// This is not exported to bindings users as a slice of tuples isn't exportable.
479483
pub fn payment_paths(&self) -> &[(BlindedPath, BlindedPayInfo)] {
480484
&self.contents.fields().payment_paths[..]
481485
}
@@ -516,6 +520,8 @@ impl Invoice {
516520

517521
/// Fallback addresses for paying the invoice on-chain, in order of most-preferred to
518522
/// least-preferred.
523+
///
524+
/// This is not exported to bindings users as Address is not yet mapped
519525
pub fn fallbacks(&self) -> Vec<Address> {
520526
let network = match self.network() {
521527
None => return Vec::new(),
@@ -580,6 +586,8 @@ impl Invoice {
580586
}
581587

582588
/// Signature of the invoice verified using [`Invoice::signing_pubkey`].
589+
///
590+
/// This is not exported to bindings users as SIgnature is not yet mapped.
583591
pub fn signature(&self) -> Signature {
584592
self.signature
585593
}

lightning/src/offers/invoice_request.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,8 @@ impl InvoiceRequest {
464464

465465
/// Signature of the invoice request using [`payer_id`].
466466
///
467+
/// This is not exported to bindings users as Signature is not yet mapped.
468+
///
467469
/// [`payer_id`]: Self::payer_id
468470
pub fn signature(&self) -> Signature {
469471
self.signature
@@ -572,6 +574,8 @@ impl InvoiceRequest {
572574
/// keys need to sign an [`Invoice`] for the request if they could be extracted from the
573575
/// metadata.
574576
///
577+
/// This is not exported to bindings users as KeyPair is not yet mapped.
578+
///
575579
/// [`Invoice`]: crate::offers::invoice::Invoice
576580
pub fn verify<T: secp256k1::Signing>(
577581
&self, key: &ExpandedKey, secp_ctx: &Secp256k1<T>

lightning/src/offers/offer.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,14 +705,17 @@ pub enum Amount {
705705
/// An amount of currency specified using ISO 4712.
706706
Currency {
707707
/// The currency that the amount is denominated in.
708+
///
709+
/// This is not exported to bindings users as bindings have troubles with type aliases to
710+
/// byte arrays.
708711
iso4217_code: CurrencyCode,
709712
/// The amount in the currency unit adjusted by the ISO 4712 exponent (e.g., USD cents).
710713
amount: u64,
711714
},
712715
}
713716

714717
/// An ISO 4712 three-letter currency code (e.g., USD).
715-
pub type CurrencyCode = [u8; 3];
718+
pub(crate) type CurrencyCode = [u8; 3];
716719

717720
/// Quantity of items supported by an [`Offer`].
718721
#[derive(Clone, Copy, Debug, PartialEq)]
@@ -722,7 +725,8 @@ pub enum Quantity {
722725
///
723726
/// May be used with `NonZeroU64::new(1)` but prefer to use [`Quantity::One`] if only one item
724727
/// is supported.
725-
Bounded(NonZeroU64),
728+
Bounded(/// This is not exported to bindings users as builder patterns don't map outside of move semantics.
729+
NonZeroU64),
726730
/// One or more items. Use when more than one item can be requested without any limit.
727731
Unbounded,
728732
/// Only one item. Use when only a single item can be requested.

lightning/src/offers/parse.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ pub enum ParseError {
127127
/// being parsed.
128128
InvalidBech32Hrp,
129129
/// The string could not be bech32 decoded.
130-
Bech32(bech32::Error),
130+
Bech32(/// This is not exported to bindings users as the details don't matter much
131+
bech32::Error),
131132
/// The bech32 decoded string could not be decoded as the expected message type.
132133
Decode(DecodeError),
133134
/// The parsed message has invalid semantics.

0 commit comments

Comments
 (0)