Skip to content

Commit 4c05087

Browse files
committed
Introduce ChannelSignerType.
1 parent 9e18e13 commit 4c05087

File tree

10 files changed

+225
-191
lines changed

10 files changed

+225
-191
lines changed

lightning-background-processor/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ impl BackgroundProcessor {
724724
T: 'static + Deref + Send + Sync,
725725
ES: 'static + Deref + Send + Sync,
726726
NS: 'static + Deref + Send + Sync,
727-
SP: 'static + Deref + Send + Sync,
727+
SP: 'static + Deref + Clone + Send + Sync,
728728
F: 'static + Deref + Send + Sync,
729729
R: 'static + Deref + Send + Sync,
730730
G: 'static + Deref<Target = NetworkGraph<L>> + Send + Sync,

lightning-invoice/src/payment.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use core::time::Duration;
3232
/// with the same [`PaymentHash`] is never sent.
3333
///
3434
/// If you wish to use a different payment idempotency token, see [`pay_invoice_with_id`].
35-
pub fn pay_invoice<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, L: Deref>(
35+
pub fn pay_invoice<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref + Clone, F: Deref, R: Deref, L: Deref>(
3636
invoice: &Bolt11Invoice, retry_strategy: Retry,
3737
channelmanager: &ChannelManager<M, T, ES, NS, SP, F, R, L>
3838
) -> Result<PaymentId, PaymentError>
@@ -61,7 +61,7 @@ where
6161
/// [`PaymentHash`] has never been paid before.
6262
///
6363
/// See [`pay_invoice`] for a variant which uses the [`PaymentHash`] for the idempotency token.
64-
pub fn pay_invoice_with_id<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, L: Deref>(
64+
pub fn pay_invoice_with_id<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref + Clone, F: Deref, R: Deref, L: Deref>(
6565
invoice: &Bolt11Invoice, payment_id: PaymentId, retry_strategy: Retry,
6666
channelmanager: &ChannelManager<M, T, ES, NS, SP, F, R, L>
6767
) -> Result<(), PaymentError>
@@ -88,7 +88,7 @@ where
8888
///
8989
/// If you wish to use a different payment idempotency token, see
9090
/// [`pay_zero_value_invoice_with_id`].
91-
pub fn pay_zero_value_invoice<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, L: Deref>(
91+
pub fn pay_zero_value_invoice<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref + Clone, F: Deref, R: Deref, L: Deref>(
9292
invoice: &Bolt11Invoice, amount_msats: u64, retry_strategy: Retry,
9393
channelmanager: &ChannelManager<M, T, ES, NS, SP, F, R, L>
9494
) -> Result<PaymentId, PaymentError>
@@ -119,7 +119,7 @@ where
119119
///
120120
/// See [`pay_zero_value_invoice`] for a variant which uses the [`PaymentHash`] for the
121121
/// idempotency token.
122-
pub fn pay_zero_value_invoice_with_id<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, L: Deref>(
122+
pub fn pay_zero_value_invoice_with_id<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref + Clone, F: Deref, R: Deref, L: Deref>(
123123
invoice: &Bolt11Invoice, amount_msats: u64, payment_id: PaymentId, retry_strategy: Retry,
124124
channelmanager: &ChannelManager<M, T, ES, NS, SP, F, R, L>
125125
) -> Result<(), PaymentError>
@@ -191,7 +191,7 @@ trait Payer {
191191
) -> Result<(), PaymentError>;
192192
}
193193

194-
impl<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, L: Deref> Payer for ChannelManager<M, T, ES, NS, SP, F, R, L>
194+
impl<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref + Clone, F: Deref, R: Deref, L: Deref> Payer for ChannelManager<M, T, ES, NS, SP, F, R, L>
195195
where
196196
M::Target: chain::Watch<<SP::Target as SignerProvider>::Signer>,
197197
T::Target: BroadcasterInterface,

lightning-invoice/src/utils.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ fn rotate_through_iterators<T, I: Iterator<Item = T>>(mut vecs: Vec<I>) -> impl
329329
/// confirmations during routing.
330330
///
331331
/// [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
332-
pub fn create_invoice_from_channelmanager<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, L: Deref>(
332+
pub fn create_invoice_from_channelmanager<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref + Clone, F: Deref, R: Deref, L: Deref>(
333333
channelmanager: &ChannelManager<M, T, ES, NS, SP, F, R, L>, node_signer: NS, logger: L,
334334
network: Currency, amt_msat: Option<u64>, description: String, invoice_expiry_delta_secs: u32,
335335
min_final_cltv_expiry_delta: Option<u16>,
@@ -370,7 +370,7 @@ where
370370
/// confirmations during routing.
371371
///
372372
/// [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
373-
pub fn create_invoice_from_channelmanager_with_description_hash<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, L: Deref>(
373+
pub fn create_invoice_from_channelmanager_with_description_hash<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref + Clone, F: Deref, R: Deref, L: Deref>(
374374
channelmanager: &ChannelManager<M, T, ES, NS, SP, F, R, L>, node_signer: NS, logger: L,
375375
network: Currency, amt_msat: Option<u64>, description_hash: Sha256,
376376
invoice_expiry_delta_secs: u32, min_final_cltv_expiry_delta: Option<u16>,
@@ -400,7 +400,7 @@ where
400400
/// See [`create_invoice_from_channelmanager_with_description_hash`]
401401
/// This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
402402
/// available and the current time is supplied by the caller.
403-
pub fn create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, L: Deref>(
403+
pub fn create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref + Clone, F: Deref, R: Deref, L: Deref>(
404404
channelmanager: &ChannelManager<M, T, ES, NS, SP, F, R, L>, node_signer: NS, logger: L,
405405
network: Currency, amt_msat: Option<u64>, description_hash: Sha256,
406406
duration_since_epoch: Duration, invoice_expiry_delta_secs: u32, min_final_cltv_expiry_delta: Option<u16>,
@@ -425,7 +425,7 @@ pub fn create_invoice_from_channelmanager_with_description_hash_and_duration_sin
425425
/// See [`create_invoice_from_channelmanager`]
426426
/// This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
427427
/// available and the current time is supplied by the caller.
428-
pub fn create_invoice_from_channelmanager_and_duration_since_epoch<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, L: Deref>(
428+
pub fn create_invoice_from_channelmanager_and_duration_since_epoch<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref + Clone, F: Deref, R: Deref, L: Deref>(
429429
channelmanager: &ChannelManager<M, T, ES, NS, SP, F, R, L>, node_signer: NS, logger: L,
430430
network: Currency, amt_msat: Option<u64>, description: String, duration_since_epoch: Duration,
431431
invoice_expiry_delta_secs: u32, min_final_cltv_expiry_delta: Option<u16>,
@@ -449,7 +449,7 @@ pub fn create_invoice_from_channelmanager_and_duration_since_epoch<M: Deref, T:
449449
)
450450
}
451451

452-
fn _create_invoice_from_channelmanager_and_duration_since_epoch<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, L: Deref>(
452+
fn _create_invoice_from_channelmanager_and_duration_since_epoch<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref + Clone, F: Deref, R: Deref, L: Deref>(
453453
channelmanager: &ChannelManager<M, T, ES, NS, SP, F, R, L>, node_signer: NS, logger: L,
454454
network: Currency, amt_msat: Option<u64>, description: Bolt11InvoiceDescription,
455455
duration_since_epoch: Duration, invoice_expiry_delta_secs: u32, min_final_cltv_expiry_delta: Option<u16>,
@@ -482,7 +482,7 @@ fn _create_invoice_from_channelmanager_and_duration_since_epoch<M: Deref, T: Der
482482
/// This version allows for providing a custom [`PaymentHash`] for the invoice.
483483
/// This may be useful if you're building an on-chain swap or involving another protocol where
484484
/// the payment hash is also involved outside the scope of lightning.
485-
pub fn create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, L: Deref>(
485+
pub fn create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref + Clone, F: Deref, R: Deref, L: Deref>(
486486
channelmanager: &ChannelManager<M, T, ES, NS, SP, F, R, L>, node_signer: NS, logger: L,
487487
network: Currency, amt_msat: Option<u64>, description: String, duration_since_epoch: Duration,
488488
invoice_expiry_delta_secs: u32, payment_hash: PaymentHash, min_final_cltv_expiry_delta: Option<u16>,
@@ -511,7 +511,7 @@ pub fn create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_
511511
)
512512
}
513513

514-
fn _create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, L: Deref>(
514+
fn _create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref + Clone, F: Deref, R: Deref, L: Deref>(
515515
channelmanager: &ChannelManager<M, T, ES, NS, SP, F, R, L>, node_signer: NS, logger: L,
516516
network: Currency, amt_msat: Option<u64>, description: Bolt11InvoiceDescription,
517517
duration_since_epoch: Duration, invoice_expiry_delta_secs: u32, payment_hash: PaymentHash,

lightning/src/events/bump_transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use crate::ln::chan_utils::{
2626
use crate::ln::features::ChannelTypeFeatures;
2727
use crate::ln::PaymentPreimage;
2828
use crate::prelude::*;
29-
use crate::sign::{ChannelSigner, EcdsaChannelSigner, SignerProvider, WriteableEcdsaChannelSigner};
29+
use crate::sign::{EcdsaChannelSigner, SignerProvider, WriteableEcdsaChannelSigner};
3030
use crate::sync::Mutex;
3131
use crate::util::logger::Logger;
3232

0 commit comments

Comments
 (0)