mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: add required trait bounds to DB type (#7960)
This commit is contained in:
@ -1,7 +1,10 @@
|
||||
//! Traits for configuring a node
|
||||
|
||||
use crate::{primitives::NodePrimitives, ConfigureEvm, EngineTypes};
|
||||
use reth_db::database::Database;
|
||||
use reth_db::{
|
||||
database::Database,
|
||||
database_metrics::{DatabaseMetadata, DatabaseMetrics},
|
||||
};
|
||||
use reth_network::NetworkHandle;
|
||||
use reth_payload_builder::PayloadBuilderHandle;
|
||||
use reth_provider::FullProvider;
|
||||
@ -25,11 +28,11 @@ pub trait NodeTypes: Send + Sync + 'static {
|
||||
fn evm_config(&self) -> Self::Evm;
|
||||
}
|
||||
|
||||
/// A helper type that is downstream of the [NodeTypes] trait and adds stateful components to the
|
||||
/// A helper trait that is downstream of the [NodeTypes] trait and adds stateful components to the
|
||||
/// node.
|
||||
pub trait FullNodeTypes: NodeTypes + 'static {
|
||||
/// Underlying database type.
|
||||
type DB: Database + Clone + 'static;
|
||||
/// Underlying database type used by the node to store and retrieve data.
|
||||
type DB: Database + DatabaseMetrics + DatabaseMetadata + Clone + Unpin + 'static;
|
||||
/// The provider type used to interact with the node.
|
||||
type Provider: FullProvider<Self::DB>;
|
||||
}
|
||||
@ -71,7 +74,7 @@ impl<Types, DB, Provider> FullNodeTypes for FullNodeTypesAdapter<Types, DB, Prov
|
||||
where
|
||||
Types: NodeTypes,
|
||||
Provider: FullProvider<DB>,
|
||||
DB: Database + Clone + 'static,
|
||||
DB: Database + DatabaseMetrics + DatabaseMetadata + Clone + Unpin + 'static,
|
||||
{
|
||||
type DB = DB;
|
||||
type Provider = Provider;
|
||||
|
||||
@ -187,7 +187,7 @@ impl<DB> NodeBuilder<DB> {
|
||||
|
||||
impl<DB> NodeBuilder<DB>
|
||||
where
|
||||
DB: Database + Unpin + Clone + 'static,
|
||||
DB: Database + DatabaseMetrics + DatabaseMetadata + Clone + Unpin + 'static,
|
||||
{
|
||||
/// Configures the types of the node.
|
||||
pub fn with_types<T>(self, types: T) -> NodeBuilderWithTypes<RethFullAdapter<DB, T>>
|
||||
|
||||
Reference in New Issue
Block a user