|
9 | 9 |
|
10 | 10 | //! Tests that test the creation of dual-funded channels in ChannelManager.
|
11 | 11 |
|
12 |
| -use bitcoin::Weight; |
13 |
| - |
14 |
| -use crate::chain::chaininterface::{ConfirmationTarget, FeeEstimator, LowerBoundedFeeEstimator}; |
15 |
| -use crate::events::{Event, MessageSendEvent, MessageSendEventsProvider}; |
16 |
| -use crate::ln::chan_utils::{ |
17 |
| - make_funding_redeemscript, ChannelPublicKeys, ChannelTransactionParameters, |
18 |
| - CounterpartyChannelTransactionParameters, |
19 |
| -}; |
20 |
| -use crate::ln::channel::{ |
21 |
| - calculate_our_funding_satoshis, OutboundV2Channel, MIN_CHAN_DUST_LIMIT_SATOSHIS, |
| 12 | +#[cfg(dual_funding)] |
| 13 | +use { |
| 14 | + crate::chain::chaininterface::{ConfirmationTarget, FeeEstimator, LowerBoundedFeeEstimator}, |
| 15 | + crate::events::{Event, MessageSendEvent, MessageSendEventsProvider}, |
| 16 | + crate::ln::chan_utils::{ |
| 17 | + make_funding_redeemscript, ChannelPublicKeys, ChannelTransactionParameters, |
| 18 | + CounterpartyChannelTransactionParameters, |
| 19 | + }, |
| 20 | + crate::ln::channel::{ |
| 21 | + calculate_our_funding_satoshis, OutboundV2Channel, MIN_CHAN_DUST_LIMIT_SATOSHIS, |
| 22 | + }, |
| 23 | + crate::ln::channel_keys::{DelayedPaymentBasepoint, HtlcBasepoint, RevocationBasepoint}, |
| 24 | + crate::ln::functional_test_utils::*, |
| 25 | + crate::ln::msgs::ChannelMessageHandler, |
| 26 | + crate::ln::msgs::{CommitmentSigned, TxAddInput, TxAddOutput, TxComplete}, |
| 27 | + crate::ln::types::ChannelId, |
| 28 | + crate::prelude::*, |
| 29 | + crate::sign::{ChannelSigner as _, P2WPKH_WITNESS_WEIGHT}, |
| 30 | + crate::util::ser::TransactionU16LenLimited, |
| 31 | + crate::util::test_utils, |
| 32 | + bitcoin::Weight, |
22 | 33 | };
|
23 |
| -use crate::ln::channel_keys::{DelayedPaymentBasepoint, HtlcBasepoint, RevocationBasepoint}; |
24 |
| -use crate::ln::functional_test_utils::*; |
25 |
| -use crate::ln::msgs::ChannelMessageHandler; |
26 |
| -use crate::ln::msgs::{CommitmentSigned, TxAddInput, TxAddOutput, TxComplete}; |
27 |
| -use crate::ln::types::ChannelId; |
28 |
| -use crate::prelude::*; |
29 |
| -use crate::sign::{ChannelSigner as _, P2WPKH_WITNESS_WEIGHT}; |
30 |
| -use crate::util::ser::TransactionU16LenLimited; |
31 |
| -use crate::util::test_utils; |
32 | 34 |
|
| 35 | +#[cfg(dual_funding)] |
33 | 36 | // Dual-funding: V2 Channel Establishment Tests
|
34 | 37 | struct V2ChannelEstablishmentTestSession {
|
35 | 38 | initiator_input_value_satoshis: u64,
|
36 | 39 | }
|
37 | 40 |
|
| 41 | +#[cfg(dual_funding)] |
38 | 42 | // TODO(dual_funding): Use real node and API for creating V2 channels as initiator when available,
|
39 | 43 | // instead of manually constructing messages.
|
40 | 44 | fn do_test_v2_channel_establishment(
|
@@ -252,6 +256,7 @@ fn do_test_v2_channel_establishment(
|
252 | 256 | }
|
253 | 257 |
|
254 | 258 | #[test]
|
| 259 | +#[cfg(dual_funding)] |
255 | 260 | fn test_v2_channel_establishment() {
|
256 | 261 | // Only initiator contributes, no persist pending
|
257 | 262 | do_test_v2_channel_establishment(
|
|
0 commit comments