diff --git a/Cargo.toml b/Cargo.toml index 8100af7..d6dc202 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,8 +16,8 @@ members = [ "p2p/monero-p2p", "p2p/async-buffer", "p2p/address-book", - "storage/cuprate-blockchain", - "storage/cuprate-txpool", + "storage/blockchain", + "storage/txpool", "storage/database", "pruning", "test-utils", diff --git a/consensus/fast-sync/Cargo.toml b/consensus/fast-sync/Cargo.toml index bfd973c..de9d082 100644 --- a/consensus/fast-sync/Cargo.toml +++ b/consensus/fast-sync/Cargo.toml @@ -10,7 +10,7 @@ path = "src/create.rs" [dependencies] clap = { workspace = true, features = ["derive", "std"] } -cuprate-blockchain = { path = "../../storage/cuprate-blockchain" } +cuprate-blockchain = { path = "../../storage/blockchain" } cuprate-types = { path = "../../types" } hex.workspace = true hex-literal.workspace = true diff --git a/storage/cuprate-blockchain/Cargo.toml b/storage/blockchain/Cargo.toml similarity index 100% rename from storage/cuprate-blockchain/Cargo.toml rename to storage/blockchain/Cargo.toml diff --git a/storage/cuprate-blockchain/OLD_README.md b/storage/blockchain/OLD_README.md similarity index 100% rename from storage/cuprate-blockchain/OLD_README.md rename to storage/blockchain/OLD_README.md diff --git a/storage/cuprate-blockchain/README.md b/storage/blockchain/README.md similarity index 100% rename from storage/cuprate-blockchain/README.md rename to storage/blockchain/README.md diff --git a/storage/cuprate-blockchain/src/config/backend.rs b/storage/blockchain/src/config/backend.rs similarity index 100% rename from storage/cuprate-blockchain/src/config/backend.rs rename to storage/blockchain/src/config/backend.rs diff --git a/storage/cuprate-blockchain/src/config/config.rs b/storage/blockchain/src/config/config.rs similarity index 100% rename from storage/cuprate-blockchain/src/config/config.rs rename to storage/blockchain/src/config/config.rs diff --git a/storage/cuprate-blockchain/src/config/mod.rs b/storage/blockchain/src/config/mod.rs similarity index 100% rename from storage/cuprate-blockchain/src/config/mod.rs rename to storage/blockchain/src/config/mod.rs diff --git a/storage/cuprate-blockchain/src/config/reader_threads.rs b/storage/blockchain/src/config/reader_threads.rs similarity index 100% rename from storage/cuprate-blockchain/src/config/reader_threads.rs rename to storage/blockchain/src/config/reader_threads.rs diff --git a/storage/cuprate-blockchain/src/constants.rs b/storage/blockchain/src/constants.rs similarity index 100% rename from storage/cuprate-blockchain/src/constants.rs rename to storage/blockchain/src/constants.rs diff --git a/storage/cuprate-blockchain/src/free.rs b/storage/blockchain/src/free.rs similarity index 100% rename from storage/cuprate-blockchain/src/free.rs rename to storage/blockchain/src/free.rs diff --git a/storage/cuprate-blockchain/src/lib.rs b/storage/blockchain/src/lib.rs similarity index 100% rename from storage/cuprate-blockchain/src/lib.rs rename to storage/blockchain/src/lib.rs diff --git a/storage/cuprate-blockchain/src/open_tables.rs b/storage/blockchain/src/open_tables.rs similarity index 100% rename from storage/cuprate-blockchain/src/open_tables.rs rename to storage/blockchain/src/open_tables.rs diff --git a/storage/cuprate-blockchain/src/ops/block.rs b/storage/blockchain/src/ops/block.rs similarity index 100% rename from storage/cuprate-blockchain/src/ops/block.rs rename to storage/blockchain/src/ops/block.rs diff --git a/storage/cuprate-blockchain/src/ops/blockchain.rs b/storage/blockchain/src/ops/blockchain.rs similarity index 100% rename from storage/cuprate-blockchain/src/ops/blockchain.rs rename to storage/blockchain/src/ops/blockchain.rs diff --git a/storage/cuprate-blockchain/src/ops/key_image.rs b/storage/blockchain/src/ops/key_image.rs similarity index 100% rename from storage/cuprate-blockchain/src/ops/key_image.rs rename to storage/blockchain/src/ops/key_image.rs diff --git a/storage/cuprate-blockchain/src/ops/macros.rs b/storage/blockchain/src/ops/macros.rs similarity index 100% rename from storage/cuprate-blockchain/src/ops/macros.rs rename to storage/blockchain/src/ops/macros.rs diff --git a/storage/cuprate-blockchain/src/ops/mod.rs b/storage/blockchain/src/ops/mod.rs similarity index 100% rename from storage/cuprate-blockchain/src/ops/mod.rs rename to storage/blockchain/src/ops/mod.rs diff --git a/storage/cuprate-blockchain/src/ops/output.rs b/storage/blockchain/src/ops/output.rs similarity index 100% rename from storage/cuprate-blockchain/src/ops/output.rs rename to storage/blockchain/src/ops/output.rs diff --git a/storage/cuprate-blockchain/src/ops/property.rs b/storage/blockchain/src/ops/property.rs similarity index 100% rename from storage/cuprate-blockchain/src/ops/property.rs rename to storage/blockchain/src/ops/property.rs diff --git a/storage/cuprate-blockchain/src/ops/tx.rs b/storage/blockchain/src/ops/tx.rs similarity index 100% rename from storage/cuprate-blockchain/src/ops/tx.rs rename to storage/blockchain/src/ops/tx.rs diff --git a/storage/cuprate-blockchain/src/service/free.rs b/storage/blockchain/src/service/free.rs similarity index 100% rename from storage/cuprate-blockchain/src/service/free.rs rename to storage/blockchain/src/service/free.rs diff --git a/storage/cuprate-blockchain/src/service/mod.rs b/storage/blockchain/src/service/mod.rs similarity index 100% rename from storage/cuprate-blockchain/src/service/mod.rs rename to storage/blockchain/src/service/mod.rs diff --git a/storage/cuprate-blockchain/src/service/read.rs b/storage/blockchain/src/service/read.rs similarity index 100% rename from storage/cuprate-blockchain/src/service/read.rs rename to storage/blockchain/src/service/read.rs diff --git a/storage/cuprate-blockchain/src/service/tests.rs b/storage/blockchain/src/service/tests.rs similarity index 100% rename from storage/cuprate-blockchain/src/service/tests.rs rename to storage/blockchain/src/service/tests.rs diff --git a/storage/cuprate-blockchain/src/service/types.rs b/storage/blockchain/src/service/types.rs similarity index 100% rename from storage/cuprate-blockchain/src/service/types.rs rename to storage/blockchain/src/service/types.rs diff --git a/storage/cuprate-blockchain/src/service/write.rs b/storage/blockchain/src/service/write.rs similarity index 100% rename from storage/cuprate-blockchain/src/service/write.rs rename to storage/blockchain/src/service/write.rs diff --git a/storage/cuprate-blockchain/src/tables.rs b/storage/blockchain/src/tables.rs similarity index 100% rename from storage/cuprate-blockchain/src/tables.rs rename to storage/blockchain/src/tables.rs diff --git a/storage/cuprate-blockchain/src/tests.rs b/storage/blockchain/src/tests.rs similarity index 100% rename from storage/cuprate-blockchain/src/tests.rs rename to storage/blockchain/src/tests.rs diff --git a/storage/cuprate-blockchain/src/types.rs b/storage/blockchain/src/types.rs similarity index 100% rename from storage/cuprate-blockchain/src/types.rs rename to storage/blockchain/src/types.rs diff --git a/storage/cuprate-blockchain/src/unsafe_sendable.rs b/storage/blockchain/src/unsafe_sendable.rs similarity index 100% rename from storage/cuprate-blockchain/src/unsafe_sendable.rs rename to storage/blockchain/src/unsafe_sendable.rs diff --git a/storage/database/README.md b/storage/database/README.md index 3fffeb2..f041175 100644 --- a/storage/database/README.md +++ b/storage/database/README.md @@ -95,8 +95,9 @@ use cuprate_database::{ # fn main() -> Result<(), Box> { // Create a configuration for the database environment. -let db_dir = tempfile::tempdir()?; -let config = ConfigBuilder::new(db_dir.path().to_path_buf()).build(); +let tmp_dir = tempfile::tempdir()?; +let db_dir = tmp_dir.path().to_owned(); +let config = ConfigBuilder::new(db_dir.into()).build(); // Initialize the database environment. let env = ConcreteEnv::open(config)?; diff --git a/storage/database/src/config/config.rs b/storage/database/src/config/config.rs index 8c897b7..f909c96 100644 --- a/storage/database/src/config/config.rs +++ b/storage/database/src/config/config.rs @@ -186,10 +186,11 @@ impl Config { /// ```rust /// use cuprate_database::{config::*, resize::*, DATABASE_DATA_FILENAME}; /// - /// let db_directory = tempfile::tempdir().unwrap(); - /// let config = Config::new(db_directory.path().into()); + /// let tmp_dir = tempfile::tempdir().unwrap(); + /// let db_directory = tmp_dir.path().to_owned(); + /// let config = Config::new(db_directory.clone().into()); /// - /// assert_eq!(config.db_directory(), db_directory.path()); + /// assert_eq!(*config.db_directory(), db_directory); /// assert!(config.db_file().starts_with(db_directory)); /// assert!(config.db_file().ends_with(DATABASE_DATA_FILENAME)); /// assert_eq!(config.sync_mode, SyncMode::default()); diff --git a/storage/database/src/config/mod.rs b/storage/database/src/config/mod.rs index 25efe11..19a324e 100644 --- a/storage/database/src/config/mod.rs +++ b/storage/database/src/config/mod.rs @@ -20,7 +20,7 @@ //! # fn main() -> Result<(), Box> { //! let db_dir = tempfile::tempdir()?; //! -//! let config = ConfigBuilder::new(db_dir.path().to_path_buf()) +//! let config = ConfigBuilder::new(db_dir.path().to_path_buf().into()) //! // Use the fastest sync mode. //! .sync_mode(SyncMode::Fast) //! // Build into `Config` diff --git a/storage/cuprate-txpool/Cargo.toml b/storage/txpool/Cargo.toml similarity index 100% rename from storage/cuprate-txpool/Cargo.toml rename to storage/txpool/Cargo.toml diff --git a/storage/cuprate-txpool/src/lib.rs b/storage/txpool/src/lib.rs similarity index 100% rename from storage/cuprate-txpool/src/lib.rs rename to storage/txpool/src/lib.rs