Skip to content

Commit e4dfd72

Browse files
Refactor channelmanager tests to test publicly visible apis
* Few tests were dependent on channelmanagers internal state, refactored that them to publicly visible apis
1 parent 093edef commit e4dfd72

File tree

5 files changed

+740
-19
lines changed

5 files changed

+740
-19
lines changed

lightning/src/ln/anchor_channel_configuration_tests.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
use crate::events::{Event, MessageSendEvent, MessageSendEventsProvider};
2-
use crate::ln::msgs::ChannelMessageHandler;
2+
use crate::ln::types::ChannelId;
3+
use crate::ln::functional_test_utils::*;
34
use crate::ln::msgs::ErrorAction;
4-
use crate::ln::{functional_test_utils::*, ChannelId};
5+
use crate::ln::msgs::ChannelMessageHandler;
56
use crate::prelude::*;
6-
use crate::util::config::ChannelConfigUpdate;
77
use crate::util::errors::APIError;
8+
use crate::util::config::ChannelConfigUpdate;
89

910
#[test]
1011
fn test_inbound_anchors_manual_acceptance() {

lightning/src/ln/channelmanager.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,15 +2284,15 @@ pub(crate) const ENABLE_GOSSIP_TICKS: u8 = 5;
22842284
/// The maximum number of unfunded channels we can have per-peer before we start rejecting new
22852285
/// (inbound) ones. The number of peers with unfunded channels is limited separately in
22862286
/// [`MAX_UNFUNDED_CHANNEL_PEERS`].
2287-
const MAX_UNFUNDED_CHANS_PER_PEER: usize = 4;
2287+
pub(crate) const MAX_UNFUNDED_CHANS_PER_PEER: usize = 4;
22882288

22892289
/// The maximum number of peers from which we will allow pending unfunded channels. Once we reach
22902290
/// this many peers we reject new (inbound) channels from peers with which we don't have a channel.
2291-
const MAX_UNFUNDED_CHANNEL_PEERS: usize = 50;
2291+
pub(crate) const MAX_UNFUNDED_CHANNEL_PEERS: usize = 50;
22922292

22932293
/// The maximum number of peers which we do not have a (funded) channel with. Once we reach this
22942294
/// many peers we reject new (inbound) connections.
2295-
const MAX_NO_CHANNEL_PEERS: usize = 250;
2295+
pub(crate) const MAX_NO_CHANNEL_PEERS: usize = 250;
22962296

22972297
/// Information needed for constructing an invoice route hint for this channel.
22982298
#[derive(Clone, Debug, PartialEq)]

0 commit comments

Comments
 (0)