Skip to content

Commit d287dcc

Browse files
committed
f - move docs
1 parent 8e865b2 commit d287dcc

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

lightning/src/offers/invoice.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,6 @@ impl UnsignedBolt12Invoice {
425425
}
426426
}
427427

428-
// Allows passing a function that takes `UnsignedBolt12Invoice` to `merkle::sign_message`.
429428
impl AsRef<TaggedHash> for UnsignedBolt12Invoice {
430429
fn as_ref(&self) -> &TaggedHash {
431430
&self.tagged_hash

lightning/src/offers/invoice_request.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,6 @@ impl UnsignedInvoiceRequest {
391391
}
392392
}
393393

394-
// Allows passing a function that takes `UnsignedInvoiceRequest` to `merkle::sign_message`.
395394
impl AsRef<TaggedHash> for UnsignedInvoiceRequest {
396395
fn as_ref(&self) -> &TaggedHash {
397396
&self.tagged_hash

lightning/src/offers/merkle.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ pub enum SignError<E> {
6363

6464
/// Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream, checking if it
6565
/// can be verified with the supplied `pubkey`.
66+
///
67+
/// Since `message` is any type that implements [`AsRef<TaggedHash>`], `sign` may be a closure that
68+
/// takes a message such as [`Bolt12Invoice`] or [`InvoiceRequest`]. This allows further message
69+
/// verification before signing its [`TaggedHash`].
70+
///
71+
/// [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
72+
/// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
6673
pub(super) fn sign_message<F, E, T>(
6774
sign: F, message: &T, pubkey: PublicKey,
6875
) -> Result<Signature, SignError<E>>

0 commit comments

Comments
 (0)