Skip to content

Commit 095676a

Browse files
committed
node: LexePersister -> NodePersister
1 parent 13aa35f commit 095676a

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

node/src/command/test/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::init::LexeNode;
1717
use crate::lexe::channel_manager::NodeChannelManager;
1818
use crate::lexe::logger;
1919
use crate::lexe::peer_manager::{ChannelPeer, LexePeerManager};
20-
use crate::lexe::persister::LexePersister;
20+
use crate::lexe::persister::NodePersister;
2121
use crate::types::NetworkGraphType;
2222

2323
/// Helper to return a default RunArgs struct for testing.
@@ -126,7 +126,7 @@ impl CommandTestHarness {
126126
self.node.peer_manager.clone()
127127
}
128128

129-
fn persister(&self) -> LexePersister {
129+
fn persister(&self) -> NodePersister {
130130
self.node.persister.clone()
131131
}
132132

node/src/init.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ use crate::lexe::channel_manager::{
4040
};
4141
use crate::lexe::logger::LexeTracingLogger;
4242
use crate::lexe::peer_manager::LexePeerManager;
43-
use crate::lexe::persister::LexePersister;
43+
use crate::lexe::persister::NodePersister;
4444
use crate::lexe::sync::SyncedChainListeners;
4545
use crate::types::{
4646
ApiClientType, BlockSourceType, BroadcasterType, ChainMonitorType,
@@ -67,7 +67,7 @@ pub struct LexeNode {
6767
pub channel_manager: NodeChannelManager,
6868
pub peer_manager: LexePeerManager,
6969
pub keys_manager: LexeKeysManager,
70-
pub persister: LexePersister,
70+
pub persister: NodePersister,
7171
chain_monitor: Arc<ChainMonitorType>,
7272
pub network_graph: Arc<NetworkGraphType>,
7373
invoice_payer: Arc<InvoicePayerType>,
@@ -153,7 +153,7 @@ impl LexeNode {
153153
mpsc::channel(DEFAULT_CHANNEL_SIZE);
154154

155155
// Initialize Persister
156-
let persister = LexePersister::new(
156+
let persister = NodePersister::new(
157157
api.clone(),
158158
node_pk,
159159
measurement,
@@ -554,7 +554,7 @@ async fn fetch_provisioned_secrets(
554554

555555
/// Initializes the ChannelMonitors
556556
async fn channel_monitors(
557-
persister: &LexePersister,
557+
persister: &NodePersister,
558558
keys_manager: LexeKeysManager,
559559
) -> anyhow::Result<Vec<(BlockHash, ChannelMonitorType)>> {
560560
debug!("reading channel monitors from DB");
@@ -567,7 +567,7 @@ async fn channel_monitors(
567567
/// Initializes a GossipSync and NetworkGraph
568568
async fn gossip_sync(
569569
network: Network,
570-
persister: &LexePersister,
570+
persister: &NodePersister,
571571
logger: LexeTracingLogger,
572572
) -> anyhow::Result<(Arc<NetworkGraphType>, Arc<P2PGossipSyncType>)> {
573573
debug!("initializing gossip sync and network graph");
@@ -667,7 +667,7 @@ async fn spawn_p2p_listener(
667667
fn spawn_p2p_reconnector(
668668
channel_manager: NodeChannelManager,
669669
peer_manager: LexePeerManager,
670-
persister: LexePersister,
670+
persister: NodePersister,
671671
shutdown: ShutdownChannel,
672672
) -> LxTask<()> {
673673
LxTask::spawn(async move {

node/src/lexe/background_processor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use tracing::{debug, error, info, trace, warn};
99

1010
use crate::lexe::channel_manager::NodeChannelManager;
1111
use crate::lexe::peer_manager::LexePeerManager;
12-
use crate::lexe::persister::LexePersister;
12+
use crate::lexe::persister::NodePersister;
1313
use crate::types::{
1414
ChainMonitorType, InvoicePayerType, LxTask, P2PGossipSyncType,
1515
ProbabilisticScorerType,
@@ -33,7 +33,7 @@ impl LexeBackgroundProcessor {
3333
pub fn start(
3434
channel_manager: NodeChannelManager,
3535
peer_manager: LexePeerManager,
36-
persister: LexePersister,
36+
persister: NodePersister,
3737
chain_monitor: Arc<ChainMonitorType>,
3838
event_handler: Arc<InvoicePayerType>,
3939
gossip_sync: Arc<P2PGossipSyncType>,

node/src/lexe/channel_manager/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use tracing::{debug, info};
1818

1919
use crate::lexe::logger::LexeTracingLogger;
2020
use crate::lexe::peer_manager::{ChannelPeer, LexePeerManager};
21-
use crate::lexe::persister::LexePersister;
21+
use crate::lexe::persister::NodePersister;
2222
use crate::types::{
2323
BlockSourceType, BroadcasterType, ChainMonitorType, ChannelManagerType,
2424
ChannelMonitorType, FeeEstimatorType,
@@ -136,7 +136,7 @@ impl NodeChannelManager {
136136
#[allow(clippy::too_many_arguments)]
137137
pub async fn init(
138138
args: &RunArgs,
139-
persister: &LexePersister,
139+
persister: &NodePersister,
140140
block_source: &BlockSourceType,
141141
restarting_node: &mut bool,
142142
channel_monitors: &mut [(BlockHash, ChannelMonitorType)],
@@ -201,7 +201,7 @@ impl NodeChannelManager {
201201
pub async fn open_channel(
202202
&self,
203203
peer_manager: &LexePeerManager,
204-
persister: &LexePersister,
204+
persister: &NodePersister,
205205
channel_peer: ChannelPeer,
206206
channel_value_sat: u64,
207207
) -> anyhow::Result<()> {

node/src/lexe/persister.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ const DEFAULT_RETRIES: usize = 3;
4848

4949
/// An Arc is held internally, so it is fine to clone and use directly.
5050
#[derive(Clone)] // TODO Try removing this
51-
pub struct LexePersister {
51+
pub struct NodePersister {
5252
inner: InnerPersister,
5353
}
5454

55-
impl LexePersister {
55+
impl NodePersister {
5656
pub fn new(
5757
api: ApiClientType,
5858
node_pk: PublicKey,
@@ -72,15 +72,15 @@ impl LexePersister {
7272
}
7373
}
7474

75-
impl Deref for LexePersister {
75+
impl Deref for NodePersister {
7676
type Target = InnerPersister;
7777
fn deref(&self) -> &Self::Target {
7878
&self.inner
7979
}
8080
}
8181

8282
/// The thing that actually impls the Persist trait. LDK requires that
83-
/// LexePersister Derefs to it.
83+
/// NodePersister Derefs to it.
8484
#[derive(Clone)]
8585
pub struct InnerPersister {
8686
api: ApiClientType,

node/src/repl.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use lightning_invoice::{utils, Currency, Invoice};
2222

2323
use crate::lexe::channel_manager::NodeChannelManager;
2424
use crate::lexe::peer_manager::{ChannelPeer, LexePeerManager};
25-
use crate::lexe::persister::LexePersister;
25+
use crate::lexe::persister::NodePersister;
2626
use crate::types::{
2727
HTLCStatus, InvoicePayerType, MillisatAmount, NetworkGraphType,
2828
PaymentInfo, PaymentInfoStorageType,
@@ -37,7 +37,7 @@ pub async fn poll_for_user_input(
3737
network_graph: Arc<NetworkGraphType>,
3838
inbound_payments: PaymentInfoStorageType,
3939
outbound_payments: PaymentInfoStorageType,
40-
persister: LexePersister,
40+
persister: NodePersister,
4141
network: Network,
4242
) {
4343
println!("LDK startup successful. To view available commands: \"help\".");
@@ -600,7 +600,7 @@ async fn open_channel<'a, I: Iterator<Item = &'a str>>(
600600
mut words: I,
601601
channel_manager: &NodeChannelManager,
602602
peer_manager: &LexePeerManager,
603-
persister: &LexePersister,
603+
persister: &NodePersister,
604604
) -> anyhow::Result<()> {
605605
let peer_pk_at_addr = words
606606
.next()

node/src/types/alias.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::event_handler::LdkEventHandler;
1919
use crate::lexe::bitcoind::LexeBitcoind;
2020
use crate::lexe::channel_manager::NodeChannelManager;
2121
use crate::lexe::logger::LexeTracingLogger;
22-
use crate::lexe::persister::LexePersister;
22+
use crate::lexe::persister::NodePersister;
2323
use crate::types::PaymentInfo;
2424

2525
pub type PaymentInfoStorageType = Arc<Mutex<HashMap<PaymentHash, PaymentInfo>>>;
@@ -32,7 +32,7 @@ pub type ChainMonitorType = ChainMonitor<
3232
Arc<BroadcasterType>,
3333
Arc<FeeEstimatorType>,
3434
LexeTracingLogger,
35-
LexePersister,
35+
NodePersister,
3636
>;
3737

3838
pub type PeerManagerType = PeerManager<

0 commit comments

Comments
 (0)