Skip to content

Commit

Permalink
chore: add a few missing trait bounds (#8731)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Jun 11, 2024
1 parent 218526c commit e9d8cda
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions crates/node/api/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use std::marker::PhantomData;
/// consensus layer.
///
/// This trait is intended to be stateless and only define the types of the node.
pub trait NodeTypes: Send + Sync + 'static {
pub trait NodeTypes: Send + Sync + Unpin + 'static {
/// The node's primitive types, defining basic operations and structures.
type Primitives: NodePrimitives;
/// The node's engine types, defining the interaction with the consensus engine.
Expand Down Expand Up @@ -61,11 +61,17 @@ impl<Types, DB, Provider> Default for FullNodeTypesAdapter<Types, DB, Provider>
}
}

impl<Types, DB, Provider> Clone for FullNodeTypesAdapter<Types, DB, Provider> {
fn clone(&self) -> Self {
Self { types: self.types, db: self.db, provider: self.provider }
}
}

impl<Types, DB, Provider> NodeTypes for FullNodeTypesAdapter<Types, DB, Provider>
where
Types: NodeTypes,
DB: Send + Sync + 'static,
Provider: Send + Sync + 'static,
DB: Send + Sync + Unpin + 'static,
Provider: Send + Sync + Unpin + 'static,
{
type Primitives = Types::Primitives;
type Engine = Types::Engine;
Expand Down
2 changes: 1 addition & 1 deletion crates/node/builder/src/components/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mod pool;
/// - transaction pool
/// - network
/// - payload builder.
pub trait NodeComponents<NodeTypes: FullNodeTypes>: Clone + Send + Sync + 'static {
pub trait NodeComponents<NodeTypes: FullNodeTypes>: Clone + Unpin + Send + Sync + 'static {
/// The transaction pool of the node.
type Pool: TransactionPool + Unpin;

Expand Down

0 comments on commit e9d8cda

Please sign in to comment.