Skip to content

Commit

Permalink
Move payment_store to payment submodule
Browse files Browse the repository at this point in the history
.. which declutters our top-level docs a bit.
  • Loading branch information
tnull committed Mar 5, 2024
1 parent 6f5892c commit accd010
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::io::sqlite_store::SqliteStore;
use crate::liquidity::LiquiditySource;
use crate::logger::{log_error, FilesystemLogger, Logger};
use crate::message_handler::NodeCustomMessageHandler;
use crate::payment_store::PaymentStore;
use crate::payment::payment_store::PaymentStore;
use crate::peer_store::PeerStore;
use crate::sweep::OutputSweeper;
use crate::tx_broadcaster::TransactionBroadcaster;
Expand Down
2 changes: 1 addition & 1 deletion src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{
hex_utils, ChannelManager, Config, Error, NetworkGraph, PeerInfo, PeerStore, UserChannelId,
};

use crate::payment_store::{
use crate::payment::payment_store::{
PaymentDetails, PaymentDetailsUpdate, PaymentDirection, PaymentStatus, PaymentStore,
};

Expand Down
11 changes: 6 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ mod liquidity;
mod logger;
mod message_handler;
pub mod payment;
mod payment_store;
mod peer_store;
mod sweep;
mod tx_broadcaster;
Expand Down Expand Up @@ -130,9 +129,10 @@ use connection::ConnectionManager;
use event::{EventHandler, EventQueue};
use gossip::GossipSource;
use liquidity::LiquiditySource;
use payment::{Bolt11PaymentHandler, OnchainPaymentHandler, SpontaneousPaymentHandler};
use payment_store::PaymentStore;
pub use payment_store::{LSPFeeLimits, PaymentDetails, PaymentDirection, PaymentStatus};
use payment::payment_store::PaymentStore;
use payment::{
Bolt11PaymentHandler, OnchainPaymentHandler, PaymentDetails, SpontaneousPaymentHandler,
};
use peer_store::{PeerInfo, PeerStore};
use types::{
Broadcaster, ChainMonitor, ChannelManager, DynStore, FeeEstimator, KeysManager, NetworkGraph,
Expand Down Expand Up @@ -1091,7 +1091,8 @@ impl Node {
///
/// For example, you could retrieve all stored outbound payments as follows:
/// ```
/// # use ldk_node::{Builder, Config, PaymentDirection};
/// # use ldk_node::{Builder, Config};
/// # use ldk_node::payment::PaymentDirection;
/// # use ldk_node::bitcoin::Network;
/// # let mut config = Config::default();
/// # config.network = Network::Regtest;
Expand Down
2 changes: 1 addition & 1 deletion src/payment/bolt11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::connection::ConnectionManager;
use crate::error::Error;
use crate::liquidity::LiquiditySource;
use crate::logger::{log_error, log_info, FilesystemLogger, Logger};
use crate::payment_store::{
use crate::payment::payment_store::{
LSPFeeLimits, PaymentDetails, PaymentDirection, PaymentStatus, PaymentStore,
};
use crate::peer_store::{PeerInfo, PeerStore};
Expand Down
4 changes: 3 additions & 1 deletion src/payment/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
//! Handlers for different types of payments.
//! Objects for different types of payments.

mod bolt11;
mod onchain;
pub(crate) mod payment_store;
mod spontaneous;

pub use bolt11::Bolt11PaymentHandler;
pub use onchain::OnchainPaymentHandler;
pub use payment_store::{LSPFeeLimits, PaymentDetails, PaymentDirection, PaymentStatus};
pub use spontaneous::SpontaneousPaymentHandler;
File renamed without changes.
4 changes: 3 additions & 1 deletion src/payment/spontaneous.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
use crate::config::{Config, LDK_PAYMENT_RETRY_TIMEOUT};
use crate::error::Error;
use crate::logger::{log_error, log_info, FilesystemLogger, Logger};
use crate::payment_store::{PaymentDetails, PaymentDirection, PaymentStatus, PaymentStore};
use crate::payment::payment_store::{
PaymentDetails, PaymentDirection, PaymentStatus, PaymentStore,
};
use crate::types::{ChannelManager, KeysManager};

use lightning::ln::channelmanager::{PaymentId, RecipientOnionFields, Retry, RetryableSendFailure};
Expand Down
2 changes: 2 additions & 0 deletions src/uniffi_types.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
pub use crate::payment::payment_store::{LSPFeeLimits, PaymentDirection, PaymentStatus};

pub use lightning::events::{ClosureReason, PaymentFailureReason};
pub use lightning::ln::{ChannelId, PaymentHash, PaymentPreimage, PaymentSecret};
pub use lightning::util::string::UntrustedString;
Expand Down
5 changes: 2 additions & 3 deletions tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
#![allow(dead_code)]

use ldk_node::io::sqlite_store::SqliteStore;
use ldk_node::{
Builder, Config, Event, LogLevel, Node, NodeError, PaymentDirection, PaymentStatus,
};
use ldk_node::payment::{PaymentDirection, PaymentStatus};
use ldk_node::{Builder, Config, Event, LogLevel, Node, NodeError};

use lightning::ln::msgs::SocketAddress;
use lightning::util::persist::KVStore;
Expand Down

0 comments on commit accd010

Please sign in to comment.