From c818479b8ec72ee5b838a90b2ce84d2b4c23e180 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 28 Sep 2023 03:03:38 +0000 Subject: [PATCH] `crate`-only several BOLT12 methods that require unbounded generics These are not expressible in C/most languages, and thus must be hidden. --- lightning/src/offers/invoice.rs | 2 +- lightning/src/offers/invoice_request.rs | 2 +- lightning/src/offers/merkle.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lightning/src/offers/invoice.rs b/lightning/src/offers/invoice.rs index fb47fd8c5..afbd82f74 100644 --- a/lightning/src/offers/invoice.rs +++ b/lightning/src/offers/invoice.rs @@ -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(mut self, sign: F) -> Result> + pub(crate) fn sign(mut self, sign: F) -> Result> where F: FnOnce(&Self) -> Result { diff --git a/lightning/src/offers/invoice_request.rs b/lightning/src/offers/invoice_request.rs index bd6d58371..b7f48e2dd 100644 --- a/lightning/src/offers/invoice_request.rs +++ b/lightning/src/offers/invoice_request.rs @@ -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(mut self, sign: F) -> Result> + pub(crate) fn sign(mut self, sign: F) -> Result> where F: FnOnce(&Self) -> Result { diff --git a/lightning/src/offers/merkle.rs b/lightning/src/offers/merkle.rs index 7390b58fe..395538d71 100644 --- a/lightning/src/offers/merkle.rs +++ b/lightning/src/offers/merkle.rs @@ -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 for TaggedHash { /// Error when signing messages. #[derive(Debug, PartialEq)] -pub enum SignError { +pub(crate) enum SignError { /// User-defined error when signing the message. Signing(E), /// Error when verifying the produced signature using the given pubkey. -- 2.39.5