#[test]
fn test_justice_tx_htlc_timeout() {
// Test justice txn built on revoked HTLC-Timeout tx, against both sides
- let mut alice_config = UserConfig::default();
+ let mut alice_config = test_default_channel_config();
alice_config.channel_handshake_config.announced_channel = true;
alice_config.channel_handshake_limits.force_announced_channel_preference = false;
alice_config.channel_handshake_config.our_to_self_delay = 6 * 24 * 5;
- let mut bob_config = UserConfig::default();
+ let mut bob_config = test_default_channel_config();
bob_config.channel_handshake_config.announced_channel = true;
bob_config.channel_handshake_limits.force_announced_channel_preference = false;
bob_config.channel_handshake_config.our_to_self_delay = 6 * 24 * 3;
#[test]
fn test_justice_tx_htlc_success() {
// Test justice txn built on revoked HTLC-Success tx, against both sides
- let mut alice_config = UserConfig::default();
+ let mut alice_config = test_default_channel_config();
alice_config.channel_handshake_config.announced_channel = true;
alice_config.channel_handshake_limits.force_announced_channel_preference = false;
alice_config.channel_handshake_config.our_to_self_delay = 6 * 24 * 5;
- let mut bob_config = UserConfig::default();
+ let mut bob_config = test_default_channel_config();
bob_config.channel_handshake_config.announced_channel = true;
bob_config.channel_handshake_limits.force_announced_channel_preference = false;
bob_config.channel_handshake_config.our_to_self_delay = 6 * 24 * 3;
use crate::ln::{channel, ChannelId};
use crate::ln::channelmanager::{BREAKDOWN_TIMEOUT, PaymentId, RecipientOnionFields};
use crate::ln::msgs::ChannelMessageHandler;
-use crate::util::config::UserConfig;
use crate::crypto::utils::sign;
use crate::util::ser::Writeable;
use crate::util::scid_utils::block_from_scid;
// emitted by LDK, such that the consumer can attach fees to the zero fee HTLC transactions.
let mut chanmon_cfgs = create_chanmon_cfgs(2);
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
- let mut anchors_config = UserConfig::default();
+ let mut anchors_config = test_default_channel_config();
anchors_config.channel_handshake_config.announced_channel = true;
anchors_config.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx = true;
anchors_config.manually_accept_inbound_channels = true;
let bob_persister;
let bob_chain_monitor;
- let mut anchors_config = UserConfig::default();
+ let mut anchors_config = test_default_channel_config();
anchors_config.channel_handshake_config.announced_channel = true;
anchors_config.channel_handshake_config.negotiate_anchors_zero_fee_htlc_tx = true;
anchors_config.manually_accept_inbound_channels = true;
use crate::routing::gossip::{NetworkUpdate, RoutingFees};
use crate::routing::router::{get_route, PaymentParameters, Route, RouteParameters, RouteHint, RouteHintHop};
use crate::ln::features::{InitFeatures, Bolt11InvoiceFeatures};
+use crate::ln::functional_test_utils::test_default_channel_config;
use crate::ln::msgs;
use crate::ln::msgs::{ChannelMessageHandler, ChannelUpdate, OutboundTrampolinePayload};
use crate::ln::wire::Encode;
// to 2000, which is above the default value of 1000 set in create_node_chanmgrs.
// This exposed a previous bug because we were using the wrong value all the way down in
// Channel::get_counterparty_htlc_minimum_msat().
- let mut node_2_cfg: UserConfig = Default::default();
+ let mut node_2_cfg: UserConfig = test_default_channel_config();
node_2_cfg.channel_handshake_config.our_htlc_minimum_msat = 2000;
node_2_cfg.channel_handshake_config.announced_channel = true;
node_2_cfg.channel_handshake_limits.force_announced_channel_preference = false;