From ac690e8191aadd7e726f48bb7814941f655d404b Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 21 Dec 2022 16:38:28 +0000 Subject: [PATCH 1/2] Clean up use ordering introduced in 9d7bb73b599a7a9d8468a2f0c54d28f 9d7bb73b599a7a9d8468a2f0c54d28f0ce6cf543 moved some code around unnecessarily, which we fix here. --- lightning/src/util/test_utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightning/src/util/test_utils.rs b/lightning/src/util/test_utils.rs index f4b751663ee..4f74791a173 100644 --- a/lightning/src/util/test_utils.rs +++ b/lightning/src/util/test_utils.rs @@ -36,6 +36,7 @@ use bitcoin::network::constants::Network; use bitcoin::hash_types::{BlockHash, Txid}; use bitcoin::secp256k1::{SecretKey, PublicKey, Secp256k1, ecdsa::Signature, Scalar}; +use bitcoin::secp256k1::ecdh::SharedSecret; use bitcoin::secp256k1::ecdsa::RecoverableSignature; use regex; @@ -51,7 +52,6 @@ use crate::chain::keysinterface::{InMemorySigner, Recipient, KeyMaterial, Entrop #[cfg(feature = "std")] use std::time::{SystemTime, UNIX_EPOCH}; -use bitcoin::secp256k1::ecdh::SharedSecret; use bitcoin::Sequence; pub struct TestVecWriter(pub Vec); From fa42b5ea8288faacd2a1cf67269c8f764ecd6326 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 21 Dec 2022 16:39:37 +0000 Subject: [PATCH 2/2] Fix capitalization broken in 9d7bb73b599a7a9d8468a2f0c54d28f0ce6cf5 9d7bb73b599a7a9d8468a2f0c54d28f0ce6cf543 broke some capitalization in docs for `sign_invoice`, which we fix here as well as taking this opportunity to clean up the `sign_invoice` docs more generally. --- lightning/src/chain/keysinterface.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lightning/src/chain/keysinterface.rs b/lightning/src/chain/keysinterface.rs index 76781376f4b..58abe7e9ddc 100644 --- a/lightning/src/chain/keysinterface.rs +++ b/lightning/src/chain/keysinterface.rs @@ -483,10 +483,12 @@ pub trait NodeSigner { fn ecdh(&self, recipient: Recipient, other_key: &PublicKey, tweak: Option<&Scalar>) -> Result; /// Sign an invoice. + /// /// By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of /// this trait to parse the invoice and make sure they're signing what they expect, rather than /// blindly signing the hash. - /// The hrp is ascii bytes, while the invoice data is base32. + /// + /// The `hrp_bytes` are ASCII bytes, while the `invoice_data` is base32. /// /// The secret key used to sign the invoice is dependent on the [`Recipient`]. ///