]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Tweak generics on `derive_channel_signer` to be bindings-compatible
authorMatt Corallo <git@bluematt.me>
Tue, 18 Jul 2023 19:04:56 +0000 (19:04 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 18 Jul 2023 20:08:07 +0000 (20:08 +0000)
The C bindings generation currently has issues looking through a
generic associated type. While this should be fixed in the bindings
generator, its easy to fix here for now and we can revisit it
later.

lightning/src/events/bump_transaction.rs

index bf56a84ca469b3bac5b4bff53eac17134800e251..e56035b562be2444cd1601e4da43b4ef36be702a 100644 (file)
@@ -26,7 +26,7 @@ use crate::ln::chan_utils::{
 use crate::ln::features::ChannelTypeFeatures;
 use crate::ln::PaymentPreimage;
 use crate::prelude::*;
-use crate::sign::{ChannelSigner, EcdsaChannelSigner, SignerProvider};
+use crate::sign::{ChannelSigner, EcdsaChannelSigner, SignerProvider, WriteableEcdsaChannelSigner};
 use crate::sync::Mutex;
 use crate::util::logger::Logger;
 
@@ -102,9 +102,9 @@ impl AnchorDescriptor {
        }
 
        /// Derives the channel signer required to sign the anchor input.
-       pub fn derive_channel_signer<SP: Deref>(&self, signer_provider: &SP) -> <SP::Target as SignerProvider>::Signer
+       pub fn derive_channel_signer<S: WriteableEcdsaChannelSigner, SP: Deref>(&self, signer_provider: &SP) -> S
        where
-               SP::Target: SignerProvider
+               SP::Target: SignerProvider<Signer = S>
        {
                let mut signer = signer_provider.derive_channel_signer(
                        self.channel_derivation_parameters.value_satoshis,
@@ -211,9 +211,9 @@ impl HTLCDescriptor {
        }
 
        /// Derives the channel signer required to sign the HTLC input.
-       pub fn derive_channel_signer<SP: Deref>(&self, signer_provider: &SP) -> <SP::Target as SignerProvider>::Signer
+       pub fn derive_channel_signer<S: WriteableEcdsaChannelSigner, SP: Deref>(&self, signer_provider: &SP) -> S
        where
-               SP::Target: SignerProvider
+               SP::Target: SignerProvider<Signer = S>
        {
                let mut signer = signer_provider.derive_channel_signer(
                        self.channel_derivation_parameters.value_satoshis,