@@ -2103,13 +2103,15 @@ pub(super) struct ChannelContext<SP: Deref> where SP::Target: SignerProvider {
2103
2103
is_holder_quiescence_initiator: Option<bool>,
2104
2104
}
2105
2105
2106
- /// A channel struct implementing this trait can receive an initial counterparty commitment
2107
- /// transaction signature.
2108
- trait InitialRemoteCommitmentReceiver<SP: Deref> where SP::Target: SignerProvider {
2106
+ /// A channel struct implementing this trait has a [`ChannelContext`], exposed through accessors.
2107
+ pub(super) trait ChannelContextProvider<SP: Deref> where SP::Target: SignerProvider {
2109
2108
fn context(&self) -> &ChannelContext<SP>;
2110
-
2111
2109
fn context_mut(&mut self) -> &mut ChannelContext<SP>;
2110
+ }
2112
2111
2112
+ /// A channel struct implementing this trait can receive an initial counterparty commitment
2113
+ /// transaction signature.
2114
+ trait InitialRemoteCommitmentReceiver<SP: Deref>: ChannelContextProvider<SP> where SP::Target: SignerProvider {
2113
2115
fn funding(&self) -> &FundingScope;
2114
2116
2115
2117
fn funding_mut(&mut self) -> &mut FundingScope;
@@ -2226,15 +2228,17 @@ trait InitialRemoteCommitmentReceiver<SP: Deref> where SP::Target: SignerProvide
2226
2228
}
2227
2229
}
2228
2230
2229
- impl<SP: Deref> InitialRemoteCommitmentReceiver <SP> for OutboundV1Channel<SP> where SP::Target: SignerProvider {
2231
+ impl<SP: Deref> ChannelContextProvider <SP> for OutboundV1Channel<SP> where SP::Target: SignerProvider {
2230
2232
fn context(&self) -> &ChannelContext<SP> {
2231
2233
&self.context
2232
2234
}
2233
2235
2234
2236
fn context_mut(&mut self) -> &mut ChannelContext<SP> {
2235
2237
&mut self.context
2236
2238
}
2239
+ }
2237
2240
2241
+ impl<SP: Deref> InitialRemoteCommitmentReceiver<SP> for OutboundV1Channel<SP> where SP::Target: SignerProvider {
2238
2242
fn funding(&self) -> &FundingScope {
2239
2243
&self.funding
2240
2244
}
@@ -2248,15 +2252,17 @@ impl<SP: Deref> InitialRemoteCommitmentReceiver<SP> for OutboundV1Channel<SP> wh
2248
2252
}
2249
2253
}
2250
2254
2251
- impl<SP: Deref> InitialRemoteCommitmentReceiver <SP> for InboundV1Channel<SP> where SP::Target: SignerProvider {
2255
+ impl<SP: Deref> ChannelContextProvider <SP> for InboundV1Channel<SP> where SP::Target: SignerProvider {
2252
2256
fn context(&self) -> &ChannelContext<SP> {
2253
2257
&self.context
2254
2258
}
2255
2259
2256
2260
fn context_mut(&mut self) -> &mut ChannelContext<SP> {
2257
2261
&mut self.context
2258
2262
}
2263
+ }
2259
2264
2265
+ impl<SP: Deref> InitialRemoteCommitmentReceiver<SP> for InboundV1Channel<SP> where SP::Target: SignerProvider {
2260
2266
fn funding(&self) -> &FundingScope {
2261
2267
&self.funding
2262
2268
}
@@ -2270,15 +2276,19 @@ impl<SP: Deref> InitialRemoteCommitmentReceiver<SP> for InboundV1Channel<SP> whe
2270
2276
}
2271
2277
}
2272
2278
2273
- impl<SP: Deref> InitialRemoteCommitmentReceiver<SP> for FundedChannel<SP> where SP::Target: SignerProvider {
2279
+ impl<SP: Deref> ChannelContextProvider<SP> for FundedChannel<SP> where SP::Target: SignerProvider {
2280
+ #[inline]
2274
2281
fn context(&self) -> &ChannelContext<SP> {
2275
2282
&self.context
2276
2283
}
2277
2284
2285
+ #[inline]
2278
2286
fn context_mut(&mut self) -> &mut ChannelContext<SP> {
2279
2287
&mut self.context
2280
2288
}
2289
+ }
2281
2290
2291
+ impl<SP: Deref> InitialRemoteCommitmentReceiver<SP> for FundedChannel<SP> where SP::Target: SignerProvider {
2282
2292
fn funding(&self) -> &FundingScope {
2283
2293
&self.funding
2284
2294
}
0 commit comments