Skip to content

Commit a1b5e1d

Browse files
joostjagertnull
authored andcommitted
f Rename KVStore to KVStoreSync
1 parent 19b8ef6 commit a1b5e1d

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

src/builder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,17 +170,17 @@ pub enum BuildError {
170170
InvalidNodeAlias,
171171
/// We failed to read data from the [`KVStore`].
172172
///
173-
/// [`KVStore`]: lightning::util::persist::KVStore
173+
/// [`KVStore`]: lightning::util::persist::KVStoreSync
174174
ReadFailed,
175175
/// We failed to write data to the [`KVStore`].
176176
///
177-
/// [`KVStore`]: lightning::util::persist::KVStore
177+
/// [`KVStore`]: lightning::util::persist::KVStoreSync
178178
WriteFailed,
179179
/// We failed to access the given `storage_dir_path`.
180180
StoragePathAccessFailed,
181181
/// We failed to setup our [`KVStore`].
182182
///
183-
/// [`KVStore`]: lightning::util::persist::KVStore
183+
/// [`KVStore`]: lightning::util::persist::KVStoreSync
184184
KVStoreSetupFailed,
185185
/// We failed to setup the onchain wallet.
186186
WalletSetupFailed,

src/io/sqlite_store/migrations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ mod tests {
7878
use crate::io::sqlite_store::SqliteStore;
7979
use crate::io::test_utils::{do_read_write_remove_list_persist, random_storage_path};
8080

81-
use lightning::util::persist::KVStore;
81+
use lightning::util::persist::KVStoreSync;
8282

8383
use rusqlite::{named_params, Connection};
8484

src/io/sqlite_store/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use crate::io::utils::check_namespace_key_validity;
1010

1111
use lightning::io;
12-
use lightning::util::persist::KVStore;
12+
use lightning::util::persist::KVStoreSync;
1313

1414
use lightning_types::string::PrintableString;
1515

@@ -130,7 +130,7 @@ impl SqliteStore {
130130
}
131131
}
132132

133-
impl KVStore for SqliteStore {
133+
impl KVStoreSync for SqliteStore {
134134
fn read(
135135
&self, primary_namespace: &str, secondary_namespace: &str, key: &str,
136136
) -> io::Result<Vec<u8>> {

src/io/test_utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use lightning::ln::functional_test_utils::{
99
connect_block, create_announced_chan_between_nodes, create_chanmon_cfgs, create_dummy_block,
1010
create_network, create_node_cfgs, create_node_chanmgrs, send_payment,
1111
};
12-
use lightning::util::persist::{read_channel_monitors, KVStore, KVSTORE_NAMESPACE_KEY_MAX_LEN};
12+
use lightning::util::persist::{read_channel_monitors, KVStoreSync, KVSTORE_NAMESPACE_KEY_MAX_LEN};
1313

1414
use lightning::events::ClosureReason;
1515
use lightning::util::test_utils;
@@ -29,7 +29,7 @@ pub(crate) fn random_storage_path() -> PathBuf {
2929
temp_path
3030
}
3131

32-
pub(crate) fn do_read_write_remove_list_persist<K: KVStore + RefUnwindSafe>(kv_store: &K) {
32+
pub(crate) fn do_read_write_remove_list_persist<K: KVStoreSync + RefUnwindSafe>(kv_store: &K) {
3333
let data = [42u8; 32];
3434

3535
let primary_namespace = "testspace";
@@ -80,7 +80,7 @@ pub(crate) fn do_read_write_remove_list_persist<K: KVStore + RefUnwindSafe>(kv_s
8080

8181
// Integration-test the given KVStore implementation. Test relaying a few payments and check that
8282
// the persisted data is updated the appropriate number of times.
83-
pub(crate) fn do_test_store<K: KVStore + Sync>(store_0: &K, store_1: &K) {
83+
pub(crate) fn do_test_store<K: KVStoreSync + Sync>(store_0: &K, store_1: &K) {
8484
let chanmon_cfgs = create_chanmon_cfgs(2);
8585
let mut node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
8686
let chain_mon_0 = test_utils::TestChainMonitor::new(

src/io/vss_store.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use crate::io::utils::check_namespace_key_validity;
99
use bitcoin::hashes::{sha256, Hash, HashEngine, Hmac, HmacEngine};
1010
use lightning::io::{self, Error, ErrorKind};
11-
use lightning::util::persist::KVStore;
11+
use lightning::util::persist::KVStoreSync;
1212
use prost::Message;
1313
use rand::RngCore;
1414
#[cfg(test)]
@@ -127,7 +127,7 @@ impl VssStore {
127127
}
128128
}
129129

130-
impl KVStore for VssStore {
130+
impl KVStoreSync for VssStore {
131131
fn read(
132132
&self, primary_namespace: &str, secondary_namespace: &str, key: &str,
133133
) -> io::Result<Vec<u8>> {

src/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use lightning::routing::gossip;
2525
use lightning::routing::router::DefaultRouter;
2626
use lightning::routing::scoring::{ProbabilisticScorer, ProbabilisticScoringFeeParameters};
2727
use lightning::sign::InMemorySigner;
28-
use lightning::util::persist::KVStore;
28+
use lightning::util::persist::KVStoreSync;
2929
use lightning::util::ser::{Readable, Writeable, Writer};
3030
use lightning::util::sweep::OutputSweeper;
3131

@@ -38,7 +38,7 @@ use bitcoin::OutPoint;
3838

3939
use std::sync::{Arc, Mutex};
4040

41-
pub(crate) type DynStore = dyn KVStore + Sync + Send;
41+
pub(crate) type DynStore = dyn KVStoreSync + Sync + Send;
4242

4343
pub(crate) type ChainMonitor = chainmonitor::ChainMonitor<
4444
InMemorySigner,

tests/common/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use ldk_node::{
2121

2222
use lightning::ln::msgs::SocketAddress;
2323
use lightning::routing::gossip::NodeAlias;
24-
use lightning::util::persist::KVStore;
24+
use lightning::util::persist::KVStoreSync;
2525
use lightning::util::test_utils::TestStore;
2626

2727
use lightning_invoice::{Bolt11InvoiceDescription, Description};
@@ -1130,7 +1130,7 @@ impl TestSyncStore {
11301130
}
11311131
}
11321132

1133-
impl KVStore for TestSyncStore {
1133+
impl KVStoreSync for TestSyncStore {
11341134
fn read(
11351135
&self, primary_namespace: &str, secondary_namespace: &str, key: &str,
11361136
) -> lightning::io::Result<Vec<u8>> {

tests/integration_tests_rust.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use ldk_node::{Builder, Event, NodeError};
2626
use lightning::ln::channelmanager::PaymentId;
2727
use lightning::routing::gossip::{NodeAlias, NodeId};
2828
use lightning::routing::router::RouteParametersConfig;
29-
use lightning::util::persist::KVStore;
29+
use lightning::util::persist::KVStoreSync;
3030

3131
use lightning_invoice::{Bolt11InvoiceDescription, Description};
3232

@@ -242,7 +242,7 @@ fn start_stop_reinit() {
242242

243243
let esplora_url = format!("http://{}", electrsd.esplora_url.as_ref().unwrap());
244244

245-
let test_sync_store: Arc<dyn KVStore + Sync + Send> =
245+
let test_sync_store: Arc<dyn KVStoreSync + Sync + Send> =
246246
Arc::new(TestSyncStore::new(config.node_config.storage_dir_path.clone().into()));
247247

248248
let sync_config = EsploraSyncConfig { background_sync_config: None };

0 commit comments

Comments
 (0)