Skip to content

Commit ce13e42

Browse files
committed
Move payment_store to payment submodule
.. which declutters our top-level docs a bit.
1 parent 431f635 commit ce13e42

File tree

9 files changed

+19
-13
lines changed

9 files changed

+19
-13
lines changed

src/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::io::sqlite_store::SqliteStore;
1111
use crate::liquidity::LiquiditySource;
1212
use crate::logger::{log_error, FilesystemLogger, Logger};
1313
use crate::message_handler::NodeCustomMessageHandler;
14-
use crate::payment_store::PaymentStore;
14+
use crate::payment::payment_store::PaymentStore;
1515
use crate::peer_store::PeerStore;
1616
use crate::sweep::OutputSweeper;
1717
use crate::tx_broadcaster::TransactionBroadcaster;

src/event.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::{
33
hex_utils, ChannelManager, Config, Error, NetworkGraph, PeerInfo, PeerStore, UserChannelId,
44
};
55

6-
use crate::payment_store::{
6+
use crate::payment::payment_store::{
77
PaymentDetails, PaymentDetailsUpdate, PaymentDirection, PaymentStatus, PaymentStore,
88
};
99

src/lib.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ mod liquidity;
8989
mod logger;
9090
mod message_handler;
9191
pub mod payment;
92-
mod payment_store;
9392
mod peer_store;
9493
mod sweep;
9594
mod tx_broadcaster;
@@ -130,9 +129,10 @@ use connection::ConnectionManager;
130129
use event::{EventHandler, EventQueue};
131130
use gossip::GossipSource;
132131
use liquidity::LiquiditySource;
133-
use payment::{Bolt11PaymentHandler, OnchainPaymentHandler, SpontaneousPaymentHandler};
134-
use payment_store::PaymentStore;
135-
pub use payment_store::{LSPFeeLimits, PaymentDetails, PaymentDirection, PaymentStatus};
132+
use payment::payment_store::PaymentStore;
133+
use payment::{
134+
Bolt11PaymentHandler, OnchainPaymentHandler, PaymentDetails, SpontaneousPaymentHandler,
135+
};
136136
use peer_store::{PeerInfo, PeerStore};
137137
use types::{
138138
Broadcaster, ChainMonitor, ChannelManager, DynStore, FeeEstimator, KeysManager, NetworkGraph,
@@ -1162,7 +1162,8 @@ impl Node {
11621162
///
11631163
/// For example, you could retrieve all stored outbound payments as follows:
11641164
/// ```
1165-
/// # use ldk_node::{Builder, Config, PaymentDirection};
1165+
/// # use ldk_node::{Builder, Config};
1166+
/// # use ldk_node::payment::PaymentDirection;
11661167
/// # use ldk_node::bitcoin::Network;
11671168
/// # let mut config = Config::default();
11681169
/// # config.network = Network::Regtest;

src/payment/bolt11.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::connection::ConnectionManager;
77
use crate::error::Error;
88
use crate::liquidity::LiquiditySource;
99
use crate::logger::{log_error, log_info, FilesystemLogger, Logger};
10-
use crate::payment_store::{
10+
use crate::payment::payment_store::{
1111
LSPFeeLimits, PaymentDetails, PaymentDirection, PaymentStatus, PaymentStore,
1212
};
1313
use crate::peer_store::{PeerInfo, PeerStore};

src/payment/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
//! Handlers for different types of payments.
1+
//! Objects for different types of payments.
22
33
mod bolt11;
44
mod onchain;
5+
pub(crate) mod payment_store;
56
mod spontaneous;
67

78
pub use bolt11::Bolt11PaymentHandler;
89
pub use onchain::OnchainPaymentHandler;
10+
pub use payment_store::{LSPFeeLimits, PaymentDetails, PaymentDirection, PaymentStatus};
911
pub use spontaneous::SpontaneousPaymentHandler;
File renamed without changes.

src/payment/spontaneous.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
use crate::config::{Config, LDK_PAYMENT_RETRY_TIMEOUT};
44
use crate::error::Error;
55
use crate::logger::{log_error, log_info, FilesystemLogger, Logger};
6-
use crate::payment_store::{PaymentDetails, PaymentDirection, PaymentStatus, PaymentStore};
6+
use crate::payment::payment_store::{
7+
PaymentDetails, PaymentDirection, PaymentStatus, PaymentStore,
8+
};
79
use crate::types::{ChannelManager, KeysManager};
810

911
use lightning::ln::channelmanager::{PaymentId, RecipientOnionFields, Retry, RetryableSendFailure};

src/uniffi_types.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
pub use crate::payment::payment_store::{LSPFeeLimits, PaymentDirection, PaymentStatus};
2+
13
pub use lightning::events::{ClosureReason, PaymentFailureReason};
24
pub use lightning::ln::{ChannelId, PaymentHash, PaymentPreimage, PaymentSecret};
35
pub use lightning::util::string::UntrustedString;

tests/common.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
#![allow(dead_code)]
33

44
use ldk_node::io::sqlite_store::SqliteStore;
5-
use ldk_node::{
6-
Builder, Config, Event, LogLevel, Node, NodeError, PaymentDirection, PaymentStatus,
7-
};
5+
use ldk_node::payment::{PaymentDirection, PaymentStatus};
6+
use ldk_node::{Builder, Config, Event, LogLevel, Node, NodeError};
87

98
use lightning::ln::msgs::SocketAddress;
109
use lightning::util::persist::KVStore;

0 commit comments

Comments
 (0)