Skip to content

Commit 1293a8f

Browse files
committed
crate-only several BOLT12 methods that require unbounded generics
These are not expressible in C/most languages, and thus must be hidden.
1 parent 9c730e9 commit 1293a8f

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

lightning/src/offers/invoice.rs

Lines changed: 5 additions & 4 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 [`BlindedPaymentPath`]s for the payer to use when sending the payment.
1818
//!
19-
//! ```
19+
//! ```ignore
2020
//! extern crate bitcoin;
2121
//! extern crate lightning;
2222
//!
@@ -243,8 +243,7 @@ macro_rules! invoice_explicit_signing_pubkey_builder_methods { ($self: ident, $s
243243
Self::new(&refund.bytes, contents, ExplicitSigningPubkey {})
244244
}
245245

246-
/// Builds an unsigned [`Bolt12Invoice`] after checking for valid semantics. It can be signed by
247-
/// [`UnsignedBolt12Invoice::sign`].
246+
/// Builds an unsigned [`Bolt12Invoice`] after checking for valid semantics.
248247
pub fn build($self: $self_type) -> Result<UnsignedBolt12Invoice, Bolt12SemanticError> {
249248
#[cfg(feature = "std")] {
250249
if $self.invoice.is_offer_or_refund_expired() {
@@ -579,7 +578,9 @@ macro_rules! unsigned_invoice_sign_method { ($self: ident, $self_type: ty $(, $s
579578
/// Signs the [`TaggedHash`] of the invoice using the given function.
580579
///
581580
/// Note: The hash computation may have included unknown, odd TLV records.
582-
pub fn sign<F: SignBolt12InvoiceFn>(
581+
///
582+
/// This is not exported to bindings users as functions aren't currently mapped.
583+
pub(crate) fn sign<F: SignBolt12InvoiceFn>(
583584
$($self_mut)* $self: $self_type, sign: F
584585
) -> Result<Bolt12Invoice, SignError> {
585586
let pubkey = $self.contents.fields().signing_pubkey;

lightning/src/offers/invoice_request.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,9 @@ macro_rules! unsigned_invoice_request_sign_method { (
531531
/// Signs the [`TaggedHash`] of the invoice request using the given function.
532532
///
533533
/// Note: The hash computation may have included unknown, odd TLV records.
534-
pub fn sign<F: SignInvoiceRequestFn>(
534+
///
535+
/// This is not exported to bindings users as functions are not yet mapped.
536+
pub(crate) fn sign<F: SignInvoiceRequestFn>(
535537
$($self_mut)* $self: $self_type, sign: F
536538
) -> Result<InvoiceRequest, SignError> {
537539
let pubkey = $self.contents.payer_signing_pubkey;

lightning/src/sign/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -883,9 +883,6 @@ pub trait NodeSigner {
883883

884884
/// Signs the [`TaggedHash`] of a BOLT 12 invoice.
885885
///
886-
/// May be called by a function passed to [`UnsignedBolt12Invoice::sign`] where `invoice` is the
887-
/// callee.
888-
///
889886
/// Implementors may check that the `invoice` is expected rather than blindly signing the tagged
890887
/// hash. An `Ok` result should sign `invoice.tagged_hash().as_digest()` with the node's signing
891888
/// key or an ephemeral key to preserve privacy, whichever is associated with

0 commit comments

Comments
 (0)