mirror of
https://github.com/hinto-janai/cuprate.git
synced 2024-12-22 11:39:30 +00:00
fix imports
This commit is contained in:
parent
0b6bd2c3c0
commit
94f6b67724
6 changed files with 31 additions and 18 deletions
|
@ -3,7 +3,9 @@ use std::{fmt::Write, fs::write};
|
|||
use clap::Parser;
|
||||
use tower::{Service, ServiceExt};
|
||||
|
||||
use cuprate_blockchain::{config::ConfigBuilder, service::DatabaseReadHandle, RuntimeError};
|
||||
use cuprate_blockchain::{
|
||||
config::ConfigBuilder, cuprate_database::RuntimeError, service::DatabaseReadHandle,
|
||||
};
|
||||
use cuprate_types::blockchain::{BCReadRequest, BCResponse};
|
||||
|
||||
use cuprate_fast_sync::{hash_of_hashes, BlockId, HashOfHashes};
|
||||
|
|
|
@ -19,6 +19,14 @@ or at the very least the [`ops`] module instead of interacting with the `cuprate
|
|||
# `cuprate_database`
|
||||
Consider reading `cuprate_database`'s crate documentation before this crate, as it is the first layer.
|
||||
|
||||
If/when this crate needs is used, be sure to use the version that this crate re-exports, e.g.:
|
||||
```rust
|
||||
use cuprate_blockchain::{
|
||||
cuprate_database::RuntimeError,
|
||||
};
|
||||
```
|
||||
This ensures the types/traits used from `cuprate_database` are the same ones used by `cuprate_blockchain` internally.
|
||||
|
||||
# Feature flags
|
||||
The `service` module requires the `service` feature to be enabled.
|
||||
See the module for more documentation.
|
||||
|
@ -52,13 +60,12 @@ For examples of the higher-level APIs, see:
|
|||
- [`service`]
|
||||
|
||||
```rust
|
||||
use cuprate_database::{
|
||||
ConcreteEnv,
|
||||
Env, EnvInner,
|
||||
DatabaseRo, DatabaseRw, TxRo, TxRw,
|
||||
};
|
||||
|
||||
use cuprate_blockchain::{
|
||||
cuprate_database::{
|
||||
ConcreteEnv,
|
||||
Env, EnvInner,
|
||||
DatabaseRo, DatabaseRw, TxRo, TxRw,
|
||||
},
|
||||
config::ConfigBuilder,
|
||||
tables::{Tables, TablesMut},
|
||||
OpenTables,
|
||||
|
|
|
@ -14,9 +14,10 @@
|
|||
//!
|
||||
//! # Example
|
||||
//! ```rust
|
||||
//! use cuprate_database::{Env, config::SyncMode};
|
||||
//!
|
||||
//! use cuprate_blockchain::config::{ConfigBuilder, ReaderThreads};
|
||||
//! use cuprate_blockchain::{
|
||||
//! cuprate_database::{Env, config::SyncMode},
|
||||
//! config::{ConfigBuilder, ReaderThreads},
|
||||
//! };
|
||||
//!
|
||||
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
//! let tmp_dir = tempfile::tempdir()?;
|
||||
|
|
|
@ -121,6 +121,8 @@ pub mod ops;
|
|||
pub mod tables;
|
||||
pub mod types;
|
||||
|
||||
pub use cuprate_database;
|
||||
|
||||
//---------------------------------------------------------------------------------------------------- Feature-gated
|
||||
#[cfg(feature = "service")]
|
||||
pub mod service;
|
||||
|
|
|
@ -55,13 +55,12 @@
|
|||
//! use hex_literal::hex;
|
||||
//!
|
||||
//! use cuprate_test_utils::data::block_v16_tx0;
|
||||
//! use cuprate_database::{
|
||||
//! ConcreteEnv,
|
||||
//! Env, EnvInner,
|
||||
//! DatabaseRo, DatabaseRw, TxRo, TxRw,
|
||||
//! };
|
||||
//!
|
||||
//! use cuprate_blockchain::{
|
||||
//! cuprate_database::{
|
||||
//! ConcreteEnv,
|
||||
//! Env, EnvInner,
|
||||
//! DatabaseRo, DatabaseRw, TxRo, TxRw,
|
||||
//! },
|
||||
//! OpenTables,
|
||||
//! config::ConfigBuilder,
|
||||
//! tables::{Tables, TablesMut},
|
||||
|
|
|
@ -65,9 +65,11 @@
|
|||
//!
|
||||
//! use cuprate_types::blockchain::{BCReadRequest, BCWriteRequest, BCResponse};
|
||||
//! use cuprate_test_utils::data::block_v16_tx0;
|
||||
//! use cuprate_database::Env;
|
||||
//!
|
||||
//! use cuprate_blockchain::config::ConfigBuilder;
|
||||
//! use cuprate_blockchain::{
|
||||
//! cuprate_database::Env,
|
||||
//! config::ConfigBuilder,
|
||||
//! };
|
||||
//!
|
||||
//! # #[tokio::main]
|
||||
//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
|
Loading…
Reference in a new issue