From e9d8cdab492301b0f5680309a3a6fa3feb47555e Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 11 Jun 2024 10:53:14 +0200 Subject: [PATCH] chore: add a few missing trait bounds (#8731) --- crates/node/api/src/node.rs | 12 +++++++++--- crates/node/builder/src/components/mod.rs | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/crates/node/api/src/node.rs b/crates/node/api/src/node.rs index 810d0d8b1..b8649d858 100644 --- a/crates/node/api/src/node.rs +++ b/crates/node/api/src/node.rs @@ -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. @@ -61,11 +61,17 @@ impl Default for FullNodeTypesAdapter } } +impl Clone for FullNodeTypesAdapter { + fn clone(&self) -> Self { + Self { types: self.types, db: self.db, provider: self.provider } + } +} + impl NodeTypes for FullNodeTypesAdapter 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; diff --git a/crates/node/builder/src/components/mod.rs b/crates/node/builder/src/components/mod.rs index ef5ea4995..8d0494470 100644 --- a/crates/node/builder/src/components/mod.rs +++ b/crates/node/builder/src/components/mod.rs @@ -29,7 +29,7 @@ mod pool; /// - transaction pool /// - network /// - payload builder. -pub trait NodeComponents: Clone + Send + Sync + 'static { +pub trait NodeComponents: Clone + Unpin + Send + Sync + 'static { /// The transaction pool of the node. type Pool: TransactionPool + Unpin;