`crate`-only several BOLT12 methods that require unbounded generics
authorMatt Corallo <git@bluematt.me>
Thu, 28 Sep 2023 03:03:38 +0000 (03:03 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 24 Oct 2023 04:16:34 +0000 (04:16 +0000)
These are not expressible in C/most languages, and thus must be
hidden.

lightning/src/offers/invoice.rs
lightning/src/offers/invoice_request.rs
lightning/src/offers/merkle.rs

index fb47fd8c5f6872b32377c1eb1b5dd68cb86be4f5..afbd82f7432e9a775063680af76bbbbb2adb1b08 100644 (file)
@@ -424,7 +424,7 @@ impl UnsignedBolt12Invoice {
        /// Note: The hash computation may have included unknown, odd TLV records.
        ///
        /// This is not exported to bindings users as functions aren't currently mapped.
-       pub fn sign<F, E>(mut self, sign: F) -> Result<Bolt12Invoice, SignError<E>>
+       pub(crate) fn sign<F, E>(mut self, sign: F) -> Result<Bolt12Invoice, SignError<E>>
        where
                F: FnOnce(&Self) -> Result<Signature, E>
        {
index bd6d58371a9f316cccf6b362cc4825f27171f177..b7f48e2ddaf61193ea8aad1e85abe864ba6f3551 100644 (file)
@@ -395,7 +395,7 @@ impl UnsignedInvoiceRequest {
        /// Note: The hash computation may have included unknown, odd TLV records.
        ///
        /// This is not exported to bindings users as functions are not yet mapped.
-       pub fn sign<F, E>(mut self, sign: F) -> Result<InvoiceRequest, SignError<E>>
+       pub(crate) fn sign<F, E>(mut self, sign: F) -> Result<InvoiceRequest, SignError<E>>
        where
                F: FnOnce(&Self) -> Result<Signature, E>
        {
index 7390b58fef8ef780a68f58aa50438dcbe1979d71..395538d7147c30491eb003400184bc1acb21b8d4 100644 (file)
@@ -42,7 +42,7 @@ impl TaggedHash {
        }
 
        /// Returns the digest to sign.
-       pub fn as_digest(&self) -> &Message {
+       pub(crate) fn as_digest(&self) -> &Message {
                &self.0
        }
 }
@@ -55,7 +55,7 @@ impl AsRef<TaggedHash> for TaggedHash {
 
 /// Error when signing messages.
 #[derive(Debug, PartialEq)]
-pub enum SignError<E> {
+pub(crate) enum SignError<E> {
        /// User-defined error when signing the message.
        Signing(E),
        /// Error when verifying the produced signature using the given pubkey.