Skip to content

Commit 5a18b43

Browse files
committed
Get rid of ChannelContextProvider separation, no longer needed here
1 parent 2d73c08 commit 5a18b43

File tree

1 file changed

+7
-27
lines changed

1 file changed

+7
-27
lines changed

lightning/src/ln/channel.rs

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,15 +2348,13 @@ pub(super) struct ChannelContext<SP: Deref> where SP::Target: SignerProvider {
23482348
is_holder_quiescence_initiator: Option<bool>,
23492349
}
23502350

2351-
/// A channel struct implementing this trait has a [`ChannelContext`], exposed through accessors.
2352-
pub(super) trait ChannelContextProvider<SP: Deref> where SP::Target: SignerProvider {
2351+
/// A channel struct implementing this trait can receive an initial counterparty commitment
2352+
/// transaction signature.
2353+
trait InitialRemoteCommitmentReceiver<SP: Deref> where SP::Target: SignerProvider {
23532354
fn context(&self) -> &ChannelContext<SP>;
2355+
23542356
fn context_mut(&mut self) -> &mut ChannelContext<SP>;
2355-
}
23562357

2357-
/// A channel struct implementing this trait can receive an initial counterparty commitment
2358-
/// transaction signature.
2359-
trait InitialRemoteCommitmentReceiver<SP: Deref>: ChannelContextProvider<SP> where SP::Target: SignerProvider {
23602358
fn funding(&self) -> &FundingScope;
23612359

23622360
fn funding_mut(&mut self) -> &mut FundingScope;
@@ -2478,17 +2476,15 @@ trait InitialRemoteCommitmentReceiver<SP: Deref>: ChannelContextProvider<SP> whe
24782476
fn is_v2_established(&self) -> bool;
24792477
}
24802478

2481-
impl<SP: Deref> ChannelContextProvider<SP> for OutboundV1Channel<SP> where SP::Target: SignerProvider {
2479+
impl<SP: Deref> InitialRemoteCommitmentReceiver<SP> for OutboundV1Channel<SP> where SP::Target: SignerProvider {
24822480
fn context(&self) -> &ChannelContext<SP> {
24832481
&self.context
24842482
}
24852483

24862484
fn context_mut(&mut self) -> &mut ChannelContext<SP> {
24872485
&mut self.context
24882486
}
2489-
}
24902487

2491-
impl<SP: Deref> InitialRemoteCommitmentReceiver<SP> for OutboundV1Channel<SP> where SP::Target: SignerProvider {
24922488
fn funding(&self) -> &FundingScope {
24932489
&self.funding
24942490
}
@@ -2506,17 +2502,15 @@ impl<SP: Deref> InitialRemoteCommitmentReceiver<SP> for OutboundV1Channel<SP> wh
25062502
}
25072503
}
25082504

2509-
impl<SP: Deref> ChannelContextProvider<SP> for InboundV1Channel<SP> where SP::Target: SignerProvider {
2505+
impl<SP: Deref> InitialRemoteCommitmentReceiver<SP> for InboundV1Channel<SP> where SP::Target: SignerProvider {
25102506
fn context(&self) -> &ChannelContext<SP> {
25112507
&self.context
25122508
}
25132509

25142510
fn context_mut(&mut self) -> &mut ChannelContext<SP> {
25152511
&mut self.context
25162512
}
2517-
}
25182513

2519-
impl<SP: Deref> InitialRemoteCommitmentReceiver<SP> for InboundV1Channel<SP> where SP::Target: SignerProvider {
25202514
fn funding(&self) -> &FundingScope {
25212515
&self.funding
25222516
}
@@ -2534,7 +2528,7 @@ impl<SP: Deref> InitialRemoteCommitmentReceiver<SP> for InboundV1Channel<SP> whe
25342528
}
25352529
}
25362530

2537-
impl<SP: Deref> ChannelContextProvider<SP> for FundedChannel<SP> where SP::Target: SignerProvider {
2531+
impl<SP: Deref> InitialRemoteCommitmentReceiver<SP> for FundedChannel<SP> where SP::Target: SignerProvider {
25382532
#[inline]
25392533
fn context(&self) -> &ChannelContext<SP> {
25402534
&self.context
@@ -2544,9 +2538,7 @@ impl<SP: Deref> ChannelContextProvider<SP> for FundedChannel<SP> where SP::Targe
25442538
fn context_mut(&mut self) -> &mut ChannelContext<SP> {
25452539
&mut self.context
25462540
}
2547-
}
25482541

2549-
impl<SP: Deref> InitialRemoteCommitmentReceiver<SP> for FundedChannel<SP> where SP::Target: SignerProvider {
25502542
fn funding(&self) -> &FundingScope {
25512543
&self.funding
25522544
}
@@ -2860,18 +2852,6 @@ impl<'a, SP: Deref> NegotiatingV2ChannelView<'a, SP> where SP::Target: SignerPro
28602852
}
28612853
}
28622854

2863-
impl<SP: Deref> ChannelContextProvider<SP> for PendingV2Channel<SP> where SP::Target: SignerProvider {
2864-
#[inline]
2865-
fn context(&self) -> &ChannelContext<SP> {
2866-
&self.context
2867-
}
2868-
2869-
#[inline]
2870-
fn context_mut(&mut self) -> &mut ChannelContext<SP> {
2871-
&mut self.context
2872-
}
2873-
}
2874-
28752855
impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
28762856
fn new_for_inbound_channel<'a, ES: Deref, F: Deref, L: Deref>(
28772857
fee_estimator: &'a LowerBoundedFeeEstimator<F>,

0 commit comments

Comments
 (0)