Skip to content

Commit 816f170

Browse files
committed
f Add coverage for both anchor types supported, zero fee commits chosen
1 parent a85cb35 commit 816f170

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lightning/src/ln/channel.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13190,6 +13190,21 @@ mod tests {
1319013190
do_test_supports_channel_type(config, expected_channel_type)
1319113191
}
1319213192

13193+
#[test]
13194+
fn test_supports_zero_fee_commitments_and_htlc_tx_fee() {
13195+
// Tests that if both sides support and negotiate `anchors_zero_fee_commitments` and
13196+
// `anchors_zero_fee_htlc_tx`, the resulting `channel_type` is
13197+
// `anchors_zero_fee_commitments`.
13198+
let mut config = UserConfig::default();
13199+
config.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx = true;
13200+
config.channel_handshake_config.negotiate_anchor_zero_fee_commitments = true;
13201+
13202+
let mut expected_channel_type = ChannelTypeFeatures::empty();
13203+
expected_channel_type.set_anchor_zero_fee_commitments_required();
13204+
13205+
do_test_supports_channel_type(config, expected_channel_type)
13206+
}
13207+
1319313208
fn do_test_supports_channel_type(config: UserConfig, expected_channel_type: ChannelTypeFeatures) {
1319413209
let secp_ctx = Secp256k1::new();
1319513210
let fee_estimator = LowerBoundedFeeEstimator::new(&TestFeeEstimator{fee_est: 15000});

0 commit comments

Comments
 (0)