Skip to content

Commit ed4d8a5

Browse files
dunxenjkczyz
authored andcommitted
Test acceptor contributions in dual-funding functional tests
We can now run through the case where the acceptor contributes to an inbound channel, with either more value in inputs, or less value, leading to a different `tx_signatures` exchange order. We also cannot use dummy P2WPKH funding inputs and witnesses anymore as `funding_transaction_signed` internally verifies signatures. Hence, we create external keypairs that we can create outputs for and sign with.
1 parent e247652 commit ed4d8a5

File tree

4 files changed

+464
-5
lines changed

4 files changed

+464
-5
lines changed

lightning/src/ln/channel.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6314,6 +6314,19 @@ where
63146314
}
63156315
}
63166316

6317+
#[cfg(all(test))]
6318+
pub fn get_initial_counterparty_commitment_signatures_for_test<L: Deref>(
6319+
&mut self, funding: &mut FundingScope, logger: &L,
6320+
counterparty_next_commitment_point_override: PublicKey,
6321+
) -> Option<(Signature, Vec<Signature>)>
6322+
where
6323+
SP::Target: SignerProvider,
6324+
L::Target: Logger,
6325+
{
6326+
self.counterparty_next_commitment_point = Some(counterparty_next_commitment_point_override);
6327+
self.get_initial_counterparty_commitment_signatures(funding, logger)
6328+
}
6329+
63176330
fn check_funding_meets_minimum_depth(&self, funding: &FundingScope, height: u32) -> bool {
63186331
let minimum_depth = self
63196332
.minimum_depth(funding)

0 commit comments

Comments
 (0)