fix imports
Some checks failed
Audit / audit (push) Has been cancelled
Deny / audit (push) Has been cancelled

This commit is contained in:
hinto.janai 2024-06-17 16:57:28 -04:00
parent 0b6bd2c3c0
commit 94f6b67724
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
6 changed files with 31 additions and 18 deletions

View file

@ -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};

View file

@ -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,

View file

@ -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()?;

View file

@ -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;

View file

@ -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},

View file

@ -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>> {