Skip to content

Commit 2d2b151

Browse files
committed
Prefactor: Expose config objects via config module
.. to further de-clutter the top-level docs.
1 parent 1ddb475 commit 2d2b151

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
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: 9 additions & 4 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};
@@ -1129,6 +1128,8 @@ impl Node {
11291128
/// opening the channel.
11301129
///
11311130
/// Returns a [`UserChannelId`] allowing to locally keep track of the channel.
1131+
///
1132+
/// [`AnchorChannelsConfig::per_channel_reserve_sats`]: crate::config::AnchorChannelsConfig::per_channel_reserve_sats
11321133
pub fn open_channel(
11331134
&self, node_id: PublicKey, address: SocketAddress, channel_amount_sats: u64,
11341135
push_to_counterparty_msat: Option<u64>, channel_config: Option<ChannelConfig>,
@@ -1162,6 +1163,8 @@ impl Node {
11621163
/// opening the channel.
11631164
///
11641165
/// Returns a [`UserChannelId`] allowing to locally keep track of the channel.
1166+
///
1167+
/// [`AnchorChannelsConfig::per_channel_reserve_sats`]: crate::config::AnchorChannelsConfig::per_channel_reserve_sats
11651168
pub fn open_announced_channel(
11661169
&self, node_id: PublicKey, address: SocketAddress, channel_amount_sats: u64,
11671170
push_to_counterparty_msat: Option<u64>, channel_config: Option<ChannelConfig>,
@@ -1231,6 +1234,8 @@ impl Node {
12311234
/// Broadcasting the closing transactions will be omitted for Anchor channels if we trust the
12321235
/// counterparty to broadcast for us (see [`AnchorChannelsConfig::trusted_peers_no_reserve`]
12331236
/// for more information).
1237+
///
1238+
/// [`AnchorChannelsConfig::trusted_peers_no_reserve`]: crate::config::AnchorChannelsConfig::trusted_peers_no_reserve
12341239
pub fn force_close_channel(
12351240
&self, user_channel_id: &UserChannelId, counterparty_node_id: PublicKey,
12361241
reason: Option<String>,

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)