[Draft] RefundingChannel: combine FundedChannel and PendingV2Channel using a trait for Pending#3720
[Draft] RefundingChannel: combine FundedChannel and PendingV2Channel using a trait for Pending#3720optout21 wants to merge 2 commits intolightningdevkit:mainfrom
Conversation
|
👋 I see @wpaulino was un-assigned. |
271a6a2 to
02cc54a
Compare
| fn funding(&self) -> &FundingScope; | ||
| fn funding_mut(&mut self) -> &mut FundingScope; | ||
| fn funding_and_context_mut(&mut self) -> (&mut FundingScope, &mut ChannelContext<SP>); | ||
| fn dual_funding_context(&self) -> &DualFundingChannelContext; |
There was a problem hiding this comment.
Do we only need to use dual_funding_context in begin_interactive_funding_tx_construction? If so, seems like it should be passed into that and consumed rather than needing a method. Then you wouldn't need swap_out_dual_funding_context_inputs either.
In other words, can DualFundingChannelContext be constructed immediately before calling begin_interactive_funding_tx_construction rather than being a field on each channel type?
| // TODO Naming | ||
| pub(super) trait PendingV2ChannelTrait<SP: Deref> where SP::Target: SignerProvider { |
There was a problem hiding this comment.
How about FundingTxConstruction?
|
👋 The first review has been submitted! Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer. |
02cc54a to
94f6051
Compare
|
One additional idea to consider, as discussed today: don't introduce new phase/channelstruct, but keep using |
|
Continued in #3736, closing this one |
This is a simpler version of #3702.
The goal: create a
RefundingChannelphase, for splice negotiation, that can act both as a funded channel (pre-splice) and pending channel (transaction negotiation).How?
PendingV2ChannelTrait(name TBD) created, andPendingV2Channelimplements it. Most implememtations are moved from the struct to the traitRefundingChannelthat has aFundedChannelfor the funded, and several fields from pending for the pending.as_funded()or directly