Skip to content

Commit 307fa56

Browse files
committed
Add basic end-to-end splice tests
This adds a new test for both splice-in and splice-out in favor of maintaining the existing test. Helpers have been added to DRY up a lot of the logic necessary for driving the splice state machine forward.
1 parent 8ab0884 commit 307fa56

File tree

3 files changed

+331
-251
lines changed

3 files changed

+331
-251
lines changed

lightning/src/ln/channel.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6130,8 +6130,6 @@ where
61306130
holder_commitment_transaction_number,
61316131
self.counterparty_next_commitment_transaction_number,
61326132
);
6133-
// TODO(splicing) Forced error, as the use case is not complete
6134-
return Err(AbortReason::InternalError("Splicing not yet supported"));
61356133
} else {
61366134
self.assert_no_commitment_advancement(holder_commitment_transaction_number, "initial commitment_signed");
61376135
self.channel_state = ChannelState::FundingNegotiated(FundingNegotiatedFlags::new());

lightning/src/ln/funding.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use crate::prelude::Vec;
1717
use crate::sign::{P2TR_KEY_PATH_WITNESS_WEIGHT, P2WPKH_WITNESS_WEIGHT};
1818

1919
/// The components of a splice's funding transaction that are contributed by one party.
20+
#[derive(Debug, Clone)]
2021
pub enum SpliceContribution {
2122
/// When funds are added to a channel.
2223
SpliceIn {
@@ -85,7 +86,7 @@ impl SpliceContribution {
8586

8687
/// An input to contribute to a channel's funding transaction either when using the v2 channel
8788
/// establishment protocol or when splicing.
88-
#[derive(Clone)]
89+
#[derive(Debug, Clone)]
8990
pub struct FundingTxInput {
9091
/// The unspent [`TxOut`] that the input spends.
9192
///

0 commit comments

Comments
 (0)