Skip to content

Commit 66ca6be

Browse files
committed
Prefactor: Expose config objects via config module
.. to further de-clutter the top-level docs.
1 parent 4ccc93a commit 66ca6be

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

src/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// http://opensource.org/licenses/MIT>, at your option. You may not use this file except in
66
// accordance with one or both of these licenses.
77

8+
//! Objects for configuring the node.
9+
810
use crate::payment::SendingParameters;
911

1012
use lightning::ln::msgs::SocketAddress;

src/lib.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
mod balance;
7676
mod builder;
7777
mod chain;
78-
mod config;
78+
pub mod config;
7979
mod connection;
8080
mod error;
8181
mod event;
@@ -102,7 +102,6 @@ pub use lightning;
102102
pub use lightning_invoice;
103103

104104
pub use balance::{BalanceDetails, LightningBalance, PendingSweepBalance};
105-
pub use config::{default_config, AnchorChannelsConfig, Config};
106105
pub use error::Error as NodeError;
107106
use error::Error;
108107

@@ -122,8 +121,8 @@ pub use builder::NodeBuilder as Builder;
122121

123122
use chain::ChainSource;
124123
use config::{
125-
default_user_config, may_announce_channel, NODE_ANN_BCAST_INTERVAL, PEER_RECONNECTION_INTERVAL,
126-
RGS_SYNC_INTERVAL,
124+
default_user_config, may_announce_channel, Config, NODE_ANN_BCAST_INTERVAL,
125+
PEER_RECONNECTION_INTERVAL, RGS_SYNC_INTERVAL,
127126
};
128127
use connection::ConnectionManager;
129128
use event::{EventHandler, EventQueue};
@@ -1131,6 +1130,8 @@ impl Node {
11311130
/// opening the channel.
11321131
///
11331132
/// Returns a [`UserChannelId`] allowing to locally keep track of the channel.
1133+
///
1134+
/// [`AnchorChannelsConfig::per_channel_reserve_sats`]: crate::config::AnchorChannelsConfig::per_channel_reserve_sats
11341135
pub fn open_channel(
11351136
&self, node_id: PublicKey, address: SocketAddress, channel_amount_sats: u64,
11361137
push_to_counterparty_msat: Option<u64>, channel_config: Option<ChannelConfig>,
@@ -1164,6 +1165,8 @@ impl Node {
11641165
/// opening the channel.
11651166
///
11661167
/// Returns a [`UserChannelId`] allowing to locally keep track of the channel.
1168+
///
1169+
/// [`AnchorChannelsConfig::per_channel_reserve_sats`]: crate::config::AnchorChannelsConfig::per_channel_reserve_sats
11671170
pub fn open_announced_channel(
11681171
&self, node_id: PublicKey, address: SocketAddress, channel_amount_sats: u64,
11691172
push_to_counterparty_msat: Option<u64>, channel_config: Option<ChannelConfig>,
@@ -1233,6 +1236,8 @@ impl Node {
12331236
/// Broadcasting the closing transactions will be omitted for Anchor channels if we trust the
12341237
/// counterparty to broadcast for us (see [`AnchorChannelsConfig::trusted_peers_no_reserve`]
12351238
/// for more information).
1239+
///
1240+
/// [`AnchorChannelsConfig::trusted_peers_no_reserve`]: crate::config::AnchorChannelsConfig::trusted_peers_no_reserve
12361241
pub fn force_close_channel(
12371242
&self, user_channel_id: &UserChannelId, counterparty_node_id: PublicKey,
12381243
reason: Option<String>,
@@ -1389,7 +1394,8 @@ impl Node {
13891394
///
13901395
/// For example, you could retrieve all stored outbound payments as follows:
13911396
/// ```
1392-
/// # use ldk_node::{Builder, Config};
1397+
/// # use ldk_node::Builder;
1398+
/// # use ldk_node::config::Config;
13931399
/// # use ldk_node::payment::PaymentDirection;
13941400
/// # use ldk_node::bitcoin::Network;
13951401
/// # let mut config = Config::default();

src/uniffi_types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//
1111
// Make sure to add any re-exported items that need to be used in uniffi below.
1212

13+
pub use crate::config::{default_config, AnchorChannelsConfig};
1314
pub use crate::graph::{ChannelInfo, ChannelUpdateInfo, NodeAnnouncementInfo, NodeInfo};
1415
pub use crate::payment::store::{LSPFeeLimits, PaymentDirection, PaymentKind, PaymentStatus};
1516
pub use crate::payment::{MaxTotalRoutingFeeLimit, QrPaymentResult, SendingParameters};

tests/common/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
#![cfg(any(test, cln_test, vss_test))]
99
#![allow(dead_code)]
1010

11+
use ldk_node::config::Config;
1112
use ldk_node::io::sqlite_store::SqliteStore;
1213
use ldk_node::payment::{PaymentDirection, PaymentKind, PaymentStatus};
13-
use ldk_node::{
14-
Builder, Config, Event, LightningBalance, LogLevel, Node, NodeError, PendingSweepBalance,
15-
};
14+
use ldk_node::{Builder, Event, LightningBalance, LogLevel, Node, NodeError, PendingSweepBalance};
1615

1716
use lightning::ln::msgs::SocketAddress;
1817
use lightning::ln::{PaymentHash, PaymentPreimage};

0 commit comments

Comments
 (0)