@@ -13313,6 +13313,17 @@ mod tests {
1331313313 fn test_supports_anchors_zero_htlc_tx_fee() {
1331413314 // Tests that if both sides support and negotiate `anchors_zero_fee_htlc_tx`, it is the
1331513315 // resulting `channel_type`.
13316+ let mut config = UserConfig::default();
13317+ config.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx = true;
13318+
13319+ let mut expected_channel_type = ChannelTypeFeatures::empty();
13320+ expected_channel_type.set_static_remote_key_required();
13321+ expected_channel_type.set_anchors_zero_fee_htlc_tx_required();
13322+
13323+ do_test_supports_channel_type(config, expected_channel_type)
13324+ }
13325+
13326+ fn do_test_supports_channel_type(config: UserConfig, expected_channel_type: ChannelTypeFeatures) {
1331613327 let secp_ctx = Secp256k1::new();
1331713328 let fee_estimator = LowerBoundedFeeEstimator::new(&TestFeeEstimator{fee_est: 15000});
1331813329 let network = Network::Testnet;
@@ -13322,21 +13333,13 @@ mod tests {
1332213333 let node_id_a = PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&[1; 32]).unwrap());
1332313334 let node_id_b = PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&[2; 32]).unwrap());
1332413335
13325- let mut config = UserConfig::default();
13326- config.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx = true;
13327-
13328- // It is not enough for just the initiator to signal `option_anchors_zero_fee_htlc_tx`, both
13329- // need to signal it.
13336+ // Assert that we get `static_remotekey` when no custom config is negotiated.
1333013337 let channel_a = OutboundV1Channel::<&TestKeysInterface>::new(
1333113338 &fee_estimator, &&keys_provider, &&keys_provider, node_id_b,
1333213339 &channelmanager::provided_init_features(&UserConfig::default()), 10000000, 100000, 42,
1333313340 &config, 0, 42, None, &logger
1333413341 ).unwrap();
13335- assert!(!channel_a.funding.get_channel_type().supports_anchors_zero_fee_htlc_tx());
13336-
13337- let mut expected_channel_type = ChannelTypeFeatures::empty();
13338- expected_channel_type.set_static_remote_key_required();
13339- expected_channel_type.set_anchors_zero_fee_htlc_tx_required();
13342+ assert_eq!(channel_a.funding.get_channel_type(), &ChannelTypeFeatures::only_static_remote_key());
1334013343
1334113344 let mut channel_a = OutboundV1Channel::<&TestKeysInterface>::new(
1334213345 &fee_estimator, &&keys_provider, &&keys_provider, node_id_b,
0 commit comments